aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain
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
commitd517d83094230c82c3cdb8c93e856fe56f22e0c2 (patch)
tree9055c0f906d3961a1259aaec9390eac7c93d8ae8 /shared/src/commonMain
parent18bc70d4fa7453c1191fc446327d1e24d5defe6d (diff)
downloadetbsa-trackermap-mobile-d517d83094230c82c3cdb8c93e856fe56f22e0c2.tar.gz
etbsa-trackermap-mobile-d517d83094230c82c3cdb8c93e856fe56f22e0c2.tar.bz2
etbsa-trackermap-mobile-d517d83094230c82c3cdb8c93e856fe56f22e0c2.zip
Added comment explaining Mapnik stuff
Diffstat (limited to 'shared/src/commonMain')
-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