Cordova-plugin-googlemaps: Cannot set property 'isMap' of undefined

Created on 30 Aug 2018  路  1Comment  路  Source: mapsplugin/cordova-plugin-googlemaps

I'm submitting a ... (check one with "x")

  • [ ] question
  • [X ] any problem or bug report

OS: (check one with "x")

  • [ X] Android
  • [ ] iOS
  • [ ] Browser

cordova information: (run $> cordova plugin list)

cordova-pdf-generator 2.0.4 "PDFGenerator"
cordova-plugin-background-mode 0.7.2 "BackgroundMode"
cordova-plugin-battery-status 2.0.2 "Battery"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-googlemaps 2.4.1 "cordova-plugin-googlemaps"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-qrscanner 2.6.0 "QRScanner"
cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy"
cordova-plugin-screen-orientation 3.0.1 "Screen Orientation"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-vibration 3.1.0 "Vibration"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-toast 2.7.0 "Toast"
cordova.plugins.diagnostic 4.0.9 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
org.apache.cordova.geolocation 0.3.6 "Geolocation"
sqli-cordova-disk-space-plugin 1.0.2 "DiskSpacePlugin"

Current behavior:
Inside a try/catch - when invoking:
var div = document.getElementById("lesson-map");
var map = window.plugin.google.maps.Map.getMap(div, {
'mapType': plugin.google.maps.MapTypeId.ROADMAP,
'controls': {
'compass': false,
'myLocationButton': false,
'indoorPicker': false,
'zoom': false,
'mapToolbar' : false,
}
});

I get the error:
Cannot set property 'isMap' of undefined

Expected behavior:
Being able to invoke window.plugin.google.maps.Map.getMap without the error

Maybe just by the Issue title you can help me out understand what could be the problem here.

Thanks so much in advance.

Most helpful comment

Figured it out.
Using KendoUI framework - previous versions of this plugin allowed to instantiate a map on the onInit function of the view.
It seems with the latest version of the plugin the map has to be create on the onAfterShow event.

>All comments

Figured it out.
Using KendoUI framework - previous versions of this plugin allowed to instantiate a map on the onInit function of the view.
It seems with the latest version of the plugin the map has to be create on the onAfterShow event.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tong2203 picture Tong2203  路  5Comments

BTW18 picture BTW18  路  3Comments

bigbossmaher picture bigbossmaher  路  3Comments

christoph-puppe picture christoph-puppe  路  5Comments

TimothyFehr picture TimothyFehr  路  5Comments