From d517d83094230c82c3cdb8c93e856fe56f22e0c2 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sun, 16 Jan 2022 02:35:33 -0600 Subject: Added comment explaining Mapnik stuff --- .../kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'shared/src/commonMain') diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt index 8c58179..d4c5261 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt @@ -2,7 +2,12 @@ package mx.trackermap.TrackerMap.utils class MapCalculus { companion object { - // Source: https://github.com/openstreetmap/mapnik-stylesheets/blob/master/zoom-to-scale.txt + /** + * WhirlyGlobe library uses height rather than zoom levels, but it supports converting + * Mapnik denominator scales to height, so we can first convert zoom levels to Mapnik + * denominator scales, and then convert them to height using WhirlyGlobe. + * Source: https://github.com/openstreetmap/mapnik-stylesheets/blob/master/zoom-to-scale.txt + */ fun zoomLevelToScale(zoom: Int): Double? = when (zoom) { 1 -> 279541132.014 -- cgit v1.2.3