The Google Static Maps API version 2 is an enhanced version of the Google Static Maps API, and has replaced the original API. It contains all of the functionality of the original API and more.
The Google Static Maps API v1 API deprecation period has ended. If you are a developer that already has a website using the Google Static Maps API version 1, these upgrade tips should help you port your current site's functionality to the Google Static Maps API version 2.
Important: Maps for Work customers will have to sign their requests. Information on how to sign your request is available in the Maps for Work Web Services guide.
Instead of specifying
maptype=mobile, specify the desired map type (like
maptype=hybrid) and the parameter
mobile=true. This way, we can provide mobile optimized tiles for every map type.
The color for a path is now specified using
Similar to how the path styles were specified before, the marker styles are now specified using
key:valuepairs, separated by pipes. Marker labels are now denoted using uppercase alpha characters instead of lowercase alpha characters.
Instead of specifying the marker style after each marker parameter, specify the style at the beginning of the
markers=parameter, and that style will apply to all of the markers proceeding. If you want to show markers with different styles, just supply a new
markers=parameter for each one.
Marker labels now require uppercase alphanumeric characters in the
labelparameter. This will allow us to later supply lowercase characters if we wish.
Instead of using the
span=parameter to make sure that your static map shows a particular viewport, use the
visible=parameter instead, and specify a list of coordinates that must be shown.
frameparameter is no longer supported.
After upgrading your existing functionality, you might be interested in adding some of the new API functionality to your website. New features include:
- Locations (in
pathparameters) can now be specified as addresses instead of latitude/longitude coordinates.
- Paths can be specified as encoded polylines.
- Paths can be filled and rendered as polygons.
- Colors can now be specified as any 24-bit or 32-bit color.
For more information about using those features, read through the developer's guide.