'getMap' is not defined in GoogleMaps plugin. - googlemaps-cdv-plugin.js:133
See original GitHub issueHi. I’m gaving issuies with getting this plugin to work properly. As in title, I’m getting error in console: googlemaps-cdv-plugin.js:133 ‘getMap’ is not defined in GoogleMaps plugin. BaseClass.self.errorHandler @ googlemaps-cdv-plugin.js:133 callbackFromNative @ cordova.js:295 processMessage @ cordova.js:1081 processMessages @ cordova.js:1104 pollOnce @ cordova.js:973 pollOnceFromOnlineEvent @ cordova.js:960
I was searching for some time now and couldn’t figure why. I’ve checked all API keys, I’ve updated plugin from GIT, also tried clean install, checked if keys are in config file and manifest, check all simillar issues on one of Your wiki pages and still no luck. I’m using cordova with ionic framework. I’m testing on few devices not emulators. Strangly if I refresh page from Chrome inspect console this error is gone. It occures only on first launch of the applikaction. Can someone help me with this? Current i’m out of ideas.
The part where i initialize the map looks like this:
$APP.controller('LocalizationController', ['MapsService', '$scope', '$ionicPlatform', '$ionicModal',
function ($MapsService, $scope, $ionicPlatform, $ionicModal) {
$scope.map, $scope.markers = {}, $scope.service;
$ionicPlatform.ready(function () {
$(document).ready(function(){
$('#map_canvas').height($(document).height() - $('.top').outerHeight() - $('.app-top').outerHeight());
if (plugin) {
plugin.google.maps.Map.isAvailable(function (isAvailable, message) {
if (isAvailable) {
console.log(document.getElementById("map_canvas"));
$scope.map = plugin.google.maps.Map.getMap(document.getElementById("map_canvas"));
$scope.map.addEventListener(plugin.google.maps.event.MAP_READY, function () {
$scope.map.setOptions({
backgroundColor: 'white',
mapType: plugin.google.maps.MapTypeId.ROADMAP,
controls: {
'compass': false,
'myLocationButton': false,
'indoorPicker': false,
'zoom': false
},
gestures: {
'tilt': false,
'rotate': false
}
});
});
} else {
}
});
}
});
});
$scope.$on('$ionicView.enter', function (e) {
});
}]);
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:17 (6 by maintainers)

Top Related StackOverflow Question
Changing the project.properties to the following also solved the getmap issue for me.
cordova.system.library.1=com.google.android.gms:play-services-maps:+ cordova.system.library.2=com.google.android.gms:play-services-location:+
I fixed it without downgrading (I’m using Ionic 2): I removed the android platform and the cordova plugin, reinstalled both and then inside project.properties, changed the fixed versions of map and locations to
+