aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin/mx/trackermap
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-16 02:35:33 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-16 02:35:33 -0600
commit5d018cdfc1af8d356716dd45d81eb64dbed6b3e4 (patch)
tree9055c0f906d3961a1259aaec9390eac7c93d8ae8 /shared/src/commonMain/kotlin/mx/trackermap
parentcfb46fd31745451fffc65a95bcbdab134d12b852 (diff)
downloadetbsa-trackermap-mobile-5d018cdfc1af8d356716dd45d81eb64dbed6b3e4.tar.gz
etbsa-trackermap-mobile-5d018cdfc1af8d356716dd45d81eb64dbed6b3e4.tar.bz2
etbsa-trackermap-mobile-5d018cdfc1af8d356716dd45d81eb64dbed6b3e4.zip
Added comment explaining Mapnik stuff
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt7
1 files changed, 6 insertions, 1 deletions
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