Fix typos in comments in ExploreMapFragment.kt

This commit is contained in:
Nicolas Raoul 2025-10-11 13:59:50 +09:00 committed by GitHub
parent 2056dfe4eb
commit 2987276a27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -963,14 +963,14 @@ class ExploreMapFragment : CommonsDaggerSupportFragment(), ExploreMapContract.Vi
if (geoPoint != null) {
binding!!.mapView.controller.setCenter(geoPoint)
val overlays = binding!!.mapView.overlays
// colllects the indices of items to remove
// collects the indices of items to remove
val indicesToRemove = mutableListOf<Int>()
for (i in overlays.indices) {
if (overlays[i] is Marker || overlays[i] is ScaleDiskOverlay) {
indicesToRemove.add(i)
}
}
// removes tha items in reverse order to avoid index shifting
// removes the items in reverse order to avoid index shifting
indicesToRemove.sortedDescending().forEach { index ->
binding!!.mapView.overlays.removeAt(index)
}