marker.android.remove is not a function
See original GitHub issueWhen trying to remove a marker from the map on Android, I get the error: marker.android.remove is not a function
It works fine on iOS. I notice that the iOS code just calls marker.ios.map = null
in the removeMarker function. But the Android code invokes the method remove on the marker, marker.android.remove()
marker.android is an instance of com.google.android.gms.maps.model.MarkerOptions which doesn’t expose a remove() method. remove is a method of com.google.android.gms.maps.model.Marker
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:14 (5 by maintainers)
Top Results From Across the Web
android marker remove() method not working - Stack Overflow
First check that if your arraylist contains data and if it is then check if(marker!=null){ marker.remove(); . when you add new marker. –...
Read more >Removing Markers | Maps JavaScript API - Google Developers
This example creates a map where each click by the user creates a marker. Click the buttons to hide or delete all of...
Read more >javascript - Leaflet: How to add a marker to, or remove it from ...
Try something like this. Put the marker to a variable, and when creating a new one, it the variable already has a value...
Read more >Managing delete markers - Amazon Simple Storage Service
If you use a DeleteObject request where the current version is a delete marker (without specifying the version ID of the delete marker),...
Read more >Removing Old Markers - YouTube
Link to the playlist: https://goo.gl/pfGNnwRemoving markers from a google map.➤Google Maps and Directions Playlist:↻ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, that’s how I’m adding them. It’s adding the marker fine, removing markers doesn’t work on Android.
@tylerablake looks like it works. I was having a different issue when I was trying to re-add a marker after removing all of the markers from the map and I thought it could be failing because of the issue mentioned above. Something like:
The above fails on “addMarker” in Android but works for IOS. I just created a new marker instead of reusing the same one and it seems like it works now.
Thanks for taking the time to look into it.