cordova-plugin-googlemaps: Error when removing map

I’m submitting a … (check one with “x”) [ ] question [x] any problem or bug report [ ] feature request

The plugin version: (check one with “x”) [ ] 2.0-beta3 (github) [x] 2.0 (npm)

If you choose ‘problem or bug report’, please select OS: (check one with “x”) [x] Android [ ] iOS

cordova information: (run $> cordova plugin list)

code-push 2.0.1-beta "CodePushAcquisition"
com.adjust.sdk 4.11.3 "Adjust"
com.bma4s.sdk.plugins.cordova 1.3.5 "BMA4S"
com.cordova.plugins.cookiemaster 1.0.1 "CookieMaster"
com.googlemaps.ios 2.4.0 "Google Maps SDK for iOS"
cordova-android-play-services-gradle-release 0.0.2 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 1.1.2 "cordova-android-support-gradle-release"
cordova-fabric-plugin 1.1.9 "cordova-fabric-plugin"
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-app-event 1.2.1 "Application Events"
cordova-plugin-appavailability 0.4.2 "AppAvailability"
cordova-plugin-code-push 1.9.6-beta "CodePush"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-console 1.1.0 "Console"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-dialogs 1.3.3 "Notification"
cordova-plugin-facebook4 1.9.1 "Facebook Connect"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-opener2 2.0.19 "File Opener2"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-google-analytics 1.8.3 "Google Universal Analytics Plugin"
cordova-plugin-googlemaps 2.0.11 "cordova-plugin-googlemaps"
cordova-plugin-network-information 1.3.3 "Network Information"
cordova-plugin-splashscreen 4.0.4-dev "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-themeablebrowser 0.2.17 "ThemeableBrowser"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
de.appplant.cordova.plugin.local-notification 0.8.5 "LocalNotification"
ionic-plugin-deeplinks 1.0.15 "Ionic Deeplink Plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 2.0.0 "PushPlugin"

package.json

"dependencies": {
    "@angular/animations": "^4.3.4",
    "@angular/common": "4.3.4",
    "@angular/compiler": "4.3.4",
    "@angular/compiler-cli": "4.3.4",
    "@angular/core": "4.3.4",
    "@angular/forms": "4.3.4",
    "@angular/http": "4.3.4",
    "@angular/platform-browser": "4.3.4",
    "@angular/platform-browser-dynamic": "4.3.4",
    "@angular/platform-server": "^4.3.4",
    "@angular/router": "^4.3.4",
    "@ionic-native/android-permissions": "^4.2.1",
    "@ionic-native/app-availability": "^4.2.1",
    "@ionic-native/core": "^4.2.1",
    "@ionic-native/deeplinks": "^4.1.0",
    "@ionic-native/device": "^4.3.1",
    "@ionic-native/facebook": "^4.1.0",
    "@ionic-native/fcm": "^4.3.1",
    "@ionic-native/file": "^3.12.1",
    "@ionic-native/file-opener": "^4.2.1",
    "@ionic-native/file-transfer": "^4.2.1",
    "@ionic-native/firebase": "^4.2.1",
    "@ionic-native/google-analytics": "^4.1.0",
    "@ionic-native/google-maps": "^4.2.1",
    "@ionic-native/in-app-browser": "^4.1.0",
    "@ionic-native/keyboard": "^4.1.0",
    "@ionic-native/local-notifications": "^4.2.1",
    "@ionic-native/network": "^4.2.1",
    "@ionic-native/push": "^3.14.0",
    "@ionic-native/splash-screen": "3.12.1",
    "@ionic-native/status-bar": "^4.2.1",
    "@ionic-native/themeable-browser": "^4.2.0",
    "@ionic-native/transfer": "^3.12.1",
    "@ionic/storage": "2.0.1",
    "@ng-idle/core": "^2.0.0-beta.12",
    "@ng-idle/keepalive": "^2.0.0-beta.12",
    "@types/google-maps": "^3.2.0",
    "@types/underscore": "^1.8.1",
    "angular2-http-interceptor": "^4.0.0",
    "angular2-local-storage": "^0.2.0",
    "angular2-moment": "^1.6.0",
    "angularfire2": "^4.0.0-rc.1",
    "code-push": "^2.0.1-beta",
    "com.adjust.sdk": "^4.11.2",
    "com.bma4s.sdk.plugins.cordova": "^1.3.4",
    "com.cordova.plugins.cookiemaster": "^1.0.1",
    "com.googlemaps.ios": "https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk",
    "cordova-android": "^6.2.3",
    "cordova-android-play-services-gradle-release": "0.0.2",
    "cordova-android-support-gradle-release": "^1.0.0",
    "cordova-fabric-plugin": "^1.1.9",
    "cordova-ios": "^4.4.0",
    "cordova-plugin-android-native-pdfviewer": "^1.2.0",
    "cordova-plugin-android-permissions": "^1.0.0",
    "cordova-plugin-app-event": "^1.2.1",
    "cordova-plugin-appavailability": "^0.4.2",
    "cordova-plugin-code-push": "^1.9.6-beta",
    "cordova-plugin-compat": "^1.1.0",
    "cordova-plugin-console": "^1.0.7",
    "cordova-plugin-device": "^1.1.6",
    "cordova-plugin-dialogs": "^1.3.3",
    "cordova-plugin-facebook4": "^1.9.1",
    "cordova-plugin-file": "^4.3.3",
    "cordova-plugin-file-opener2": "^2.0.19",
    "cordova-plugin-file-transfer": "^1.6.3",
    "cordova-plugin-geolocation": "^2.4.3",
    "cordova-plugin-google-analytics": "^1.8.3",
    "cordova-plugin-googlemaps": "^2.0.0",
    "cordova-plugin-googlemaps-sdk": "https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git",
    "cordova-plugin-inappbrowser": "^1.7.1",
    "cordova-plugin-network-information": "^1.3.3",
    "cordova-plugin-splashscreen": "https://github.com/apache/cordova-plugin-splashscreen.git",
    "cordova-plugin-statusbar": "^2.2.3",
    "cordova-plugin-themeablebrowser": "https://github.com/yoleth/cordova-plugin-themeablebrowser.git",
    "cordova-plugin-whitelist": "^1.3.2",
    "cordova-plugin-zip": "^3.1.0",
    "de.appplant.cordova.plugin.local-notification": "^0.8.5",
    "firebase": "^4.3.0",
    "ionic-angular": "3.6.0",
    "ionic-native": "^2.9.0",
    "ionic-plugin-deeplinks": "https://github.com/Guidobraak9/ionic-plugin-deeplinks.git",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "ngx-clipboard": "^8.0.3",
    "node-js-marker-clusterer": "^1.0.0",
    "phonegap-plugin-push": "^2.0.0",
    "promise-polyfill": "6.0.2",
    "rxjs": "5.4.0",
    "sw-toolbox": "3.6.0",
    "underscore": "^1.8.3",
    "xcode": "^0.9.3",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@angular/cli": "^1.3.2",
    "@ionic/app-scripts": "^2.1.3",
    "gulp": "^3.9.1",
    "gulp-replace": "^0.6.1",
    "gulp-sass": "^3.1.0",
    "ionic": "3.13.1",
    "ios-sim": "^6.1.1",
    "node-sass": "^3.3.3",
    "npm": "^5.2.0",
    "typescript": "^2.4.2",
    "xcode": "^0.9.3"
  }

Current behavior: When trying to remove map, error occured and map is not removed.

vendor.js:1378 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'indexOf' of undefined
TypeError: Cannot read property 'indexOf' of undefined
    at MarkerCluster.<anonymous> (vendor.js:76393)
    at MarkerCluster.callback (BaseClass.js:101)
    at MarkerCluster.trigger (BaseClass.js:62)
    at MarkerCluster.remove (MarkerCluster.js:286)
    at clearObj (Map.js:554)
    at Map.remove (Map.js:563)
    at callInstance (vendor.js:120390)
    at vendor.js:120555
    at vendor.js:74733
    at new t (polyfills.js:3)
    at MarkerCluster.<anonymous> (vendor.js:76393)
    at MarkerCluster.callback (BaseClass.js:101)
    at MarkerCluster.trigger (BaseClass.js:62)
    at MarkerCluster.remove (MarkerCluster.js:286)
    at clearObj (Map.js:554)
    at Map.remove (Map.js:563)
    at callInstance (vendor.js:120390)
    at vendor.js:120555
    at vendor.js:74733
    at new t (polyfills.js:3)
    at c (polyfills.js:3)
    at c (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (vendor.js:4239)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at o (polyfills.js:3)
    at <anonymous>

Expected behavior: Remove map correctly

Steps to reproduce: Creat a map, add clusters and then call remove on it.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Thank you for reporting this bug. I fixed the wrapper plugin code, and send it as a PR. https://github.com/ionic-team/ionic-native/pull/2035

After the PR is merged, the ionic team will release it as a new version.

Then please reinstall the @ionic-native/core and the @ionic-native/google-maps with latest version. The problem should be gone.

The people who have been waiting the PR is accepted. The PR is still waiting. If you can’t wait it, you can build from my repository.

$> git clone https://github.com/wf9a5m75/ionic-native

$> cd ionic-native

$> node -v
7.10

$> npm run build google-maps

$> cd (your project folder)

$> npm uninstall @ionin-native/core @ionic-native/google-maps

$> npm install (path to)/ionic-native/dist/\@ionic-native/core

$> npm install (path to)/ionic-native/dist/\@ionic-native/google-maps