Image size is reduced in Google Static Map using API key

时间:2015-11-12 11:46:47

标签: api google-maps google-static-maps

My Google Static Maps image size is reduced into 640x400px using API key too. By official docs, google should enable the 2048px width image size, when you use API key. My current image src tag is https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&size=2048x400&zoom=14&key=AIzaSyDtQgHRpKBnlCfmlFyIKhliytfCb9tHgJY (I will regenerate the API key, you can use for testing purposes)

  • The API key is OK.
  • The Google Static Maps API is enabled
  • The Google Developer Console shows the requests amount (it is comunicate)

Does anyobody have idea what Im doing wrong? Thank you.

1 个答案:

答案 0 :(得分:6)

可能的大小并不取决于密钥的使用,它取决于使用的许可证。

您需要 Google Maps API for Work -license才能获得所需的图片。

来自the documentation

API                         scale=1     scale=2     scale=4
Free                        640x640     640x640     Not available.
                                        (returns 
                                        1280x1280 
                                        pixels) 

Google Maps API for Work    2048x2048   1024x1024   512x512 
                                        (returns    (returns 
                                        2048x2048   2048x2048 
                                        pixels)     pixels)