cordova-plugin-googlemaps: getmap is not defined in GoogleMaps plugin

I’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?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

Removing camera section from map options solved this for me. Is there a bug still lurking?