Save current Google Map as image

asp.net, google-maps-api-3, javascript

Solution

You can use the google maps static API : https://developers.google.com/maps/documentation/staticmaps/

You can get the parameters that you need to pass to the static maps api (e.g. center , visible region etc) from the google maps javascript api.

Problem

How can I save the current google map as an image? Below is the Javascript I use to initialize the map. ``` var myMarker = new google.maps.LatLng(result[0].centerLat, result[0].centerLong); var myOptions = { disableDoubleClickZoom: true, zoom: result[0].zoom, center: myMarker, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); ``` I had a look at https://developers.google.com/maps/documentation/javascript/reference#Map but there seems to be no method that returns a URL or image for the current map object. Is it possible to save the map as an image in some way?

Original source

Related problems