MarkerCluster.remove() not working as intended
See original GitHub issueI’m submitting a … (check one with “x”)
- question
- any problem or bug report
- feature request
If you choose ‘problem or bug report’, please select OS: (check one with “x”)
- Android
- iOS
cordova information: (run $> cordova plugin list
)
com.googlemaps.ios 2.6.0 "Google Maps SDK for iOS"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-googlemaps 2.2.5 "cordova-plugin-googlemaps"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
Current behavior: Hi, on Android when I execute the MarkerCluster.remove() function it spits out this error:
plugins/cordova-plugin-googlemaps/www/BaseClass.js:127 Cannot access to the 'remove' method.
If there are markers or marker clusters in your map camera view, then it won’t remove them. The old clusters and markers are still visible but not clickable anymore.
If you look away to place with no markers and marker clusters it removes them properly. And on iOS, it sometimes crashes when I call that function. Maybe from the above error.
Expected behavior: It should remove all the markers and clusters associated with that MarkerCluster object.
Screen capture or video record:
This was also tested on your marker cluster demo project (as seen in the above gif).
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top GitHub Comments
Ok, I updated the code. Please reinstall the plugin from the multiple_maps branch.
When it will be released, as i don’t want to rely on source code, and i can wait.
I have also reviewed the bug, and i have seen a programmatic error in your code, when you define a variable you should use the interface instead of the implementation.
The Map fix is not right also, as you should use:
private final static ConcurrentMap<String, STATUS> pluginMarkers = new ConcurrentHashMap<String, STATUS>();
ArrayList also a problem. I think that can be fixed easily on all your classes.
I’m not that fan of static member variables (it can cause lots of typical concurrency bugs, which are not easy to figure out), i think somehow the class is a little bit complex, i think, the java part can be easily refactored to introduce some official java principle.
I’m aware of that when somebody is experiencing among the solutions, the code quality can be very bad, but i would clean it up step by step if i had time on this.
It’s a massive work, so it does not make sense to me to contribute. Keep up the good work. I’m very impressed that you maintain this repository on daily basis for years now.
Most of the cordova plugin simply useless, because it’s not maintained. This is the first one, what i saw working. It was a little bit hard because the google shows me the old version of documents, maybe if something is deprecated like CAMERA_CHANGE, the old version of the document should be updated also. I was a little bit confused on the links, but the docs quality is good.