GoogleStaticMapで日本語の地図を取得する


困ったこと

で表示されているものと

$ wget "https://maps.googleapis.com/maps/api/staticmap?center=34.71360393,135.32154121&zoom=15&size=275x191&markers=34.71360393,135.32154121&sensor=true&width=275&height=191&key=AIzaSyBAEHi7Z9UA3628IuCRr0USgFSVhjwlttk&language=jp"

で取得されるものが違う。

http://www.ajaxtower.jp/googlestaticmaps/para/index11.html このへんの設定ができていないわけではない。

解決

リクエストヘッダーにAccept-Language: jpを付ける。

$ wget --header="Accept-Language: ja" "https://maps.googleapis.com/maps/api/staticmap?center=34.65188449,135.0342171&zoom=15&size=275x191&markers=34.65188449,135.0342171&sensor=true&width=275&height=191&key=AIzaSyBAEHi7Z9UA3628IuCRr0USgFSVhjwlttk&language=jp"

これでOK。