Skip to content

Commit

Permalink
uniform zoom from 17 onwards
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Mar 8, 2024
1 parent 827edfb commit 7feb6cc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fun main(args: Array<String>) {

fun createStyle(name: String, accessToken: String, languages: List<String>, colors: Colors): String {

val pathWidth = listOf(14 to 0.5, 24 to 384.0) // ~1m
val pathWidth = listOf(14 to 0.5, 17 to 3.0, 24 to 384.0) // ~1m

fun coalesceName() =
"[" +
Expand Down Expand Up @@ -137,42 +137,42 @@ fun createStyle(name: String, accessToken: String, languages: List<String>, colo
filters = listOf(tagIs("class", "street_limited"), tagIs("type", "pedestrian")),
color = colors.pedestrian,
colorOutline = colors.roadOutline,
width = listOf(13 to 1.5, 24 to 1024.0), // ~6m
width = listOf(13 to 1.5, 17 to 8.0, 24 to 1024.0), // ~6m
minZoom = 14.0
)
val serviceRoads = Road("roads-service",
filters = listOf(tagIn("class", "service", "driveway")),
color = colors.road,
colorOutline = colors.roadOutline,
width = listOf(13 to 0.5, 24 to 768.0), // ~4m
width = listOf(13 to 0.5, 17 to 6.0, 24 to 768.0), // ~4m
minZoom = 14.0
)
val minorRoads = Road("roads-minor",
filters = listOf(tagIn("class", "street", "street_limited"), tagIsNot("type", "pedestrian")),
color = colors.road,
colorOutline = colors.roadOutline,
width = listOf(11 to 0.5, 13 to 1.5, 24 to 1024.0), // ~6m
width = listOf(11 to 0.5, 17 to 8.0, 24 to 1024.0), // ~6m
minZoom = 12.0
)
val majorRoads = Road("roads-major",
filters = listOf(tagIs("class", "main")),
color = colors.road,
colorOutline = colors.roadOutline,
width = listOf(9 to 1.0, 13 to 4.5, 24 to 1536.0), // ~8m
width = listOf(9 to 1.0, 17 to 12.0, 24 to 1536.0), // ~8m
minZoom = 5.0,
)
val motorways = Road("motorways",
filters = listOf(tagIs("class", "motorway")),
color = colors.motorway,
colorOutline = colors.motorwayOutline,
width = listOf(8 to 1.0, 13 to 8.0, 24 to 2048.0), // ~12m
width = listOf(8 to 1.0, 17 to 16.0, 24 to 2048.0), // ~12m
minZoom = 5.0,
)
val motorwayLinks = Road("motorway-links",
filters = listOf(tagIs("class", "motorway_link")),
color = colors.motorway,
colorOutline = colors.motorwayOutline,
width = listOf(11 to 1.0, 13 to 1.5, 24 to 1024.0), // ~6m
width = listOf(11 to 1.0, 17 to 8.0, 24 to 1024.0), // ~6m
)

val roads = listOf(pedestrian, serviceRoads, minorRoads, majorRoads, motorways, motorwayLinks)
Expand Down

0 comments on commit 7feb6cc

Please sign in to comment.