-
Notifications
You must be signed in to change notification settings - Fork 920
Map.toDataURL()
Generate a snapshot image of the map.
###Description
You can use snapshots within your application when an interactive map would be difficult, or impossible, to use. For example, images produced with the Map.toDataURL() method can be used to display a thumbnail of the map in your app.
The Map.toDataURL() method takes a few second for generating image, then the image data is passed to the callback as Base64 encoded image (PNG file format). You can use this image data to the HTML5 Canvas.
Note: Images of the map MUST NOT be transmitted to your servers, or otherwise used outside of the application. If you need to send a map to another application or user, send data that allows them to reconstruct the map for the new user instead of a snapshot.
###code
map.toDataURL(function(imageData) {
var image = document.getElementById("snapshot");
image.src = imageData;
});If you get an error, feel free to ask me on the official community or the issue list.
New version 2.0-beta2 is available.
The cordova-googlemaps-plugin v2.0 has more faster, more features.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md
New versions will be announced through the official community. Stay tune!
Feel free to ask me on the issues tracker.
Or on the official community is also welcome!
New version 2.0-beta2 is available.
The cordova-googlemaps-plugin v2.0 has more faster, more features.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md