# Saving Area Plots as a Google Static Map

Posted by James Watson on 10 May, 2018

I've added the option to export area plot images as a Google 'static map' as shown in the sample below;

This download option may be specified by selecting the 'Google' option from the drop down menu on the Area page, the default is 'SVG'.I feel that this is the most aesthetically pleasing of the options, but it does have a few limitations;

• Google Maps static API does not support filled polygons, so it's not possible to fully replicate the standard area display. Instead, simple contours are used.
• The size of the image is restricted to 640x640 pixels which means that the extreme left and right sides of the map may be cropped. For best results, centre the map on the web-page before plotting.
• The API does not support any form of Legend to denote scale and/or contour values.
• The API is called using a request that looks like the following;

https://maps.googleapis.com/maps/api/staticmap?center=20.4869,98.013&zoom=2&size=920x400&markers=color:red%7Clabel:T%7C20.4869,98.013&path=color:0x0b599bff%7Cweight:3%7C-3.1,75.0%7C-11.5,90.0%7C-10.9,105.0%7C0.0,118.7%7C3.0,120.0%7C15.0,127.5%7C30.0,126.0%7C36.4,120.0%7....

The majority of the URL defines the contours, the more contours there are and the more complex their shape, the longer the URL becomes. Google currently has an upper limit of 8192 characters for the URL. Maps that exceed this length will fail with a warning posted to the user. In this case, it may be possible to reduce the resolution (number of points), and hence the length of the URL, by re-running the prediction at a lower resolution.