getmap is not defined in GoogleMaps plugin
See original GitHub issueI’ve tried to add the Google Maps plugin to my app, but when I use the camera option the map canvas is completely white and there’s an error: ‘getMap’ is not defined in GoogleMaps plugin.
This is the code I used:
var div = document.getElementById("map");
var map;
// Initialize the map view
map = plugin.google.maps.Map.getMap(div, {
'controls': {
'myLocationButton': true,
'zoom': true
},
'gestures': {
'scroll': true,
'tilt': true,
'rotate': true,
'zoom': true
},
'camera': {
'zoom': 15
}
});
If I remove the camera option the map canvas becomes grey with the Google logo in the left corner and the zoom buttons etc. at the right side of the screen.
This is the code I used without the camera option:
var div = document.getElementById("map");
var map;
// Initialize the map view
map = plugin.google.maps.Map.getMap(div, {
'controls': {
'myLocationButton': true,
'zoom': true
},
'gestures': {
'scroll': true,
'tilt': true,
'rotate': true,
'zoom': true
}
});
This problem is also referenced in #434.
Is this a bug or am I doing something wrong?
Issue Analytics
- State:
- Created 8 years ago
- Comments:17 (6 by maintainers)
Top Results From Across the Web
plugin is not defined (cordova-plugin-googlemaps)
I get error in $ var map = plugin.google.maps.Map.getMap(); produce "plugin is not defined" error. Thanks. cordova · google-maps-api-3 ...
Read more >Overview | Maps JavaScript API - Google Developers
Get started with the Google Maps JavaScript API. View a simple example, learn the concepts, and create custom maps for your site.
Read more >nightstomp/cordova-plugin-googlemaps - Gitter
getElementById("map_canvas"); var map = plugin.google.maps. ... I updated to 1.3.9 and am getting "'getMap' is not defined in GoogleMaps" in the console.
Read more >Manipulating the map in JS - [GM] Unable to find map
At a glance, it sounds like it's just a matter of waiting for everything to finish loading. You are trying to call a...
Read more >How to generate and set a Google Maps API key - Yoast
1. Copy the API key you created from the Google Maps Platform. 2. When you're logged in, you will be in your 'Dashboard'....
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

Removing camera section from map options solved this for me. Is there a bug still lurking?
@alfabetagama Thank you!!! This was the only thing stopped me from being android ready. Removing the camera section from
Fixed it for me.