Search code examples
apigoogle-mapsgoogle-maps-static-api

Image size is reduced in Google Static Map using API key


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.


Solution

  • The possible size doesn't depend on the usage of a key, it's depends on the used license.

    You'll need a Google Maps API for Work-license to be able to get the desired image.

    From 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)