fix: avoid map `zoomToNodes` with empty nodelist

closes #1079
pull/1094/head
andrekir 2024-06-08 10:32:35 -03:00
rodzic 5b3c78316b
commit 8e40c84c0d
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -475,7 +475,7 @@ fun MapView(
// }
fun MapView.zoomToNodes() {
val nodeMarkers = onNodesChanged(nodes)
val nodeMarkers = onNodesChanged(model.nodeDB.nodesByNum.values)
if (nodeMarkers.isNotEmpty()) {
val box = BoundingBox.fromGeoPoints(nodeMarkers.map { it.position })
val center = GeoPoint(box.centerLatitude, box.centerLongitude)