GetDataUrl without loading map on view
See original GitHub issueHi, Thanks for this plugin, it’s helpful a much;
Unfortunately, I got one problem, hope you can help;
I know it’s not recommended to save map as base64-coded image, but in my case I need load it later without internet connection. So I tried to convert it with .toDataURL(), but it breaks app like on issue #388.
I tested it on: Samsung Galaxy Tab A Android v5.0.2 Cordova v6.2
My code looks like:
var map = plugin.google.maps.Map.getMap(DOMelement);
map.setOptions(mapOptions);
map.setCenter(centerLatLng);
map.addEventListener(plugin.google.maps.event.MAP_READY, function onMapInit(map) {
map.addMarker({
'position': {
lat: lat,
lng: lng
},
'title': 'msg'
}, function (marker) {
DOMelement.class = DOMelement.class === undefined ? " mapField " : DOMelement.class + " mapField ";
map.toDataURL(function (dataUrl) {
DOMelement.src = dataUrl;
});
});
});
Probably it’s out of memory problem, like you suggest on issue #388;
To avoid memory usage I want to load map 64base-coded image without loading it on the view. Is it possible there? Or could it be done soon?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
canvas.toDataURL for Google map ground overlays
None of the Google map API's support the ability to rotate a map overlay. For an application I am writing, I need to...
Read more >Problem to generate the image of map (Google Maps) #345
Using html2canvas, but the image create doesn't show the map: ... is sudenly downloading loads of tiles to server without viewing webpage.
Read more >HTMLCanvasElement.toDataURL() - Web APIs | MDN
toDataURL () method returns a data URL containing a representation of the image in the format specified by the type parameter.
Read more >react-map-gl | default (Map) - GitHub Pages
No camera transitions are in progress; All currently requested tiles have loaded; All fade/transition animations have completed. onRemove : (event: MapboxEvent) ...
Read more >How did OpenLayers 3 managed to export map from other ...
How did OL3 managed to use toDataURL() in this case? I tried monitoring network traffic and it seems no proxy are being used...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi,
I solved problem.
Your answers was very successfully, Problem was I tried to put map into element:
I missed style=“width: something; heigth: something”.
Now I know it’s so important 😃
Not sure I missed something in documentation, but it will be great to focus that size styles should be defined BEFORE define map.
Thanks for your work!
I guess the DOMelement is not under the <body>.