refactor: scale requiredZoomLevel() by 0.8 to improve fit

This commit is contained in:
andrekir 2024-11-04 12:57:00 -03:00
parent 45d3741124
commit d4137a7dc4
3 changed files with 10 additions and 16 deletions

View file

@ -507,7 +507,7 @@ fun MapView(
val geoPoints = model.nodesWithPosition.map { GeoPoint(it.latitude, it.longitude) }
val box = BoundingBox.fromGeoPoints(geoPoints)
val center = GeoPoint(box.centerLatitude, box.centerLongitude)
val finalZoomLevel = minOf(box.requiredZoomLevel() * 0.8, maxZoomLevel)
val finalZoomLevel = minOf(box.requiredZoomLevel(), maxZoomLevel)
controller.setCenter(center)
controller.setZoom(finalZoomLevel)
} else {