You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently overlays are not replaced and you can add multiple clones.
Suppose, it needs to change List<Overlay> overlays(); to Set and rewrite overlays hash and equals methods like in data class at least.
Need to use such construction for every overlay now:
val indexToRemove = mapView.overlays.indexOfFirst { it is RadiusMarkerClusterer }
if (indexToRemove != -1) mapView.overlays[indexToRemove] = cluster else mapView.overlays.add(cluster)
The text was updated successfully, but these errors were encountered:
Psijic
changed the title
Overlay is not replaced after adding same multiple times
Overlay is not replaced after adding it multiple times
Sep 27, 2023
I don't think it's a bug.
Calling to "List overlays()" must be disallowed outside osmdroid library.
You can manage Layers by using normal List methods (add, remove, get, set, etc...) and if you don't want to add a Layer twice, you have to prev remove the existent and then add it again like in any normal ArrayList.
Arrays or Lists normally allows clones without any issue.
Currently overlays are not replaced and you can add multiple clones.
Suppose, it needs to change
List<Overlay> overlays();
toSet
and rewrite overlayshash
andequals
methods like indata class
at least.Need to use such construction for every overlay now:
The text was updated successfully, but these errors were encountered: