0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

困ったこと

image

で表示されているものと

$ 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"

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

image

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。

image

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?