question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'getMap' is not defined in GoogleMaps plugin. - googlemaps-cdv-plugin.js:133

See original GitHub issue

Hi. 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
jasonattcommented, May 20, 2017

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:+

3reactions
fxlemirecommented, Mar 14, 2017

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 +

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error using Cordova Google Maps plugin in android emulator
Remote inspection with Chrome reveals there's an error in the browser console: getMap is not defined in GoogleMaps plugin.
Read more >
Maps JavaScript API | Google Developers
Informs the caller of the current capabilities available to the map based on the Map ID that was provided. getMapTypeId. getMapTypeId(). Parameters: None....
Read more >
Adding Google Maps to a Flutter app - Google Codelabs
With the Google Maps Flutter plugin, you can add maps based on Google maps data to your application. The plugin automatically handles access ......
Read more >
google_maps_flutter | Flutter Package - Pub.dev
A Flutter plugin for integrating Google Maps in iOS and Android applications. ... Set the minSdkVersion in android/app/build.gradle :.
Read more >
google-map-react - npm
google-map -react is a component written over a small set of the Google Maps ... in the browser even if the Google Maps...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found