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.

Error when removing map

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
wf9a5m75commented, Oct 26, 2017

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.

1reaction
wf9a5m75commented, Oct 30, 2017

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: FieldMappings: Error in removing a field map from
Solved: Hi I have a layer named patro_join with 114 fields and I want to preserve only two fields ("Layer","Text") in this layer....
Read more >
map is not removed completely on `map.remove ... - GitHub
Post removal of the map, it removes the map from the element, however, if I do double click on the div, it throws...
Read more >
Remove from map doesn't work - Salesforce Stack Exchange
The first thing I'd do is extract the required collection from the Map once. Then work backwards through that collection. List<Tier__c> ...
Read more >
Removing a key-value pair from HashMap is giving an error ...
I have a set of data stored in a HashMap. The elements in the data are compared and if the condition is satisfied,...
Read more >
“map in use” error while removing multipath device in CentOS ...
The Solution · 1. Use the mount command to verify the device is not still mounted. · 2. Use the dmsetup command to...
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