diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f57f6e1c..08c118fb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Page have improved titles now, depending on where you are on the application. Helpful when you have multiple tabs with visualize.admin or when you bookmark things. [#331](https://github.com/visualize-admin/visualization-tool/pull/331) - Theme and organization navigation counts take into account the search field now. [#329](https://github.com/visualize-admin/visualization-tool/pull/329) -- Added rivers and lakes through vector layer [#309](https://github.com/visualize-admin/visualization-tool/pull/309) +- Implemented a new base layer which makes use of vector tiles [#351](https://github.com/visualize-admin/visualization-tool/pull/351) - Improved chart editing navigation [#337](https://github.com/visualize-admin/visualization-tool/pull/337) - Improved chart publish action buttons [#337](https://github.com/visualize-admin/visualization-tool/pull/337) @@ -25,9 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Maps -It is now possible to use maps as a new visualization type. Quantities can be encoded -as a scatterplot on the map. Datasets which have a shared dimension containing -geo coordinates can be charted on a map. +It is now possible to use maps as a new visualization type. Quantities can be encoded as a scatterplot on the map. Datasets which have GeoShapes or GeoCoordinates dimensions can be charted on a map. [#294](https://github.com/visualize-admin/visualization-tool/pull/294) [#289](https://github.com/visualize-admin/visualization-tool/pull/289) [#292](https://github.com/visualize-admin/visualization-tool/pull/292) [#286](https://github.com/visualize-admin/visualization-tool/pull/286) [#240](https://github.com/visualize-admin/visualization-tool/pull/240) [#293](https://github.com/visualize-admin/visualization-tool/pull/293) [#301](https://github.com/visualize-admin/visualization-tool/pull/301) [#302](https://github.com/visualize-admin/visualization-tool/pull/302) diff --git a/app/charts/index.ts b/app/charts/index.ts index 5390fdde8..91597ef0f 100644 --- a/app/charts/index.ts +++ b/app/charts/index.ts @@ -292,8 +292,7 @@ export const getInitialConfig = ({ }, }, baseLayer: { - showRelief: true, - showWater: true, + show: true, }, }; diff --git a/app/charts/map/get-base-layer-style.ts b/app/charts/map/get-base-layer-style.ts new file mode 100644 index 000000000..185cb3fb6 --- /dev/null +++ b/app/charts/map/get-base-layer-style.ts @@ -0,0 +1,5896 @@ +import { Locale } from "../../locales/locales"; + +const BORDER_COLOR = { + lowZoom: "hsl(0, 0%, 50%)", + highZoom: "hsl(0, 0%, 75%)", +}; + +interface Props { + locale: Locale; +} + +export const getBaseLayerStyle = (props: Props) => { + const { locale } = props; + const languageTag = `name:${locale === "en" ? "latin" : locale}`; + + return { + version: 8, + name: "lbm_v1.0.0", + metadata: { "maputnik:renderer": "mbgljs", "openmaptiles:version": "3.x" }, + center: [7.969664962869274, 47.021278030856564], + zoom: 9.333879434342306, + bearing: 0, + pitch: 0, + sources: { + swissmaptiles: { + type: "vector", + url: "https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.leichte-basiskarte.vt/v1.0.0/tiles.json", + }, + relief_shading: { + type: "raster", + tiles: [ + "https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.leichte-basiskarte_reliefschattierung/default/current/3857/{z}/{x}/{y}.png", + ], + tileSize: 256, + minzoom: 0, + maxzoom: 22, + }, + }, + sprite: + "https://vectortiles.geo.admin.ch/styles/ch.swisstopo.leichte-basiskarte.vt/v1.0.1/sprite/sprite", + glyphs: "https://vectortiles.geo.admin.ch/fonts/{fontstack}/{range}.pbf", + transition: {}, + layers: [ + { + id: "background", + type: "background", + layout: { visibility: "visible" }, + paint: { "background-color": "rgba(255, 255, 255, 1)" }, + }, + { + id: "relief_shading", + type: "raster", + source: "relief_shading", + layout: { visibility: "visible" }, + paint: { + "raster-opacity": { + stops: [ + [15.5, 1], + [17, 0.6], + ], + }, + "raster-brightness-min": [ + "interpolate", + ["linear"], + ["zoom"], + 6, + 0, + 12, + 0.25, + ], + "raster-saturation": [ + "interpolate", + ["linear"], + ["zoom"], + 6, + -0.5, + 12, + -0.2, + ], + "raster-contrast": [ + "interpolate", + ["linear"], + ["zoom"], + 6, + 0.1, + 12, + 0, + ], + "raster-resampling": "nearest", + }, + }, + { + id: "contour_line", + type: "line", + metadata: { "maputnik:comment": "color: rgb(191,138,64)" }, + source: "swissmaptiles", + "source-layer": "contour_line", + minzoom: 13, + filter: ["all", ["!in", "class", "rock", "ice", "water"]], + layout: { visibility: "visible" }, + paint: { + "line-blur": 0.4, + "line-color": [ + "match", + ["get", "class"], + ["ice", "water"], + "rgb(0,136,208)", + ["scree"], + "rgb(0,0,0)", + "rgb(191,138,64)", + ], + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 13, + ["match", ["get", "class"], ["scree", "ice", "water"], 0.25, 0.45], + 14, + ["match", ["get", "class"], ["scree", "ice", "water"], 0.3, 0.55], + ], + "line-width": [ + "interpolate", + ["exponential", 1], + ["zoom"], + 12, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 13, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 14, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 1, + 0, + ], + 14.5, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 1.5, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 0.75, + 0, + ], + ], + 15, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 1.75, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 1, + 0, + ], + ], + 16.5, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 2, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 10], 0], + 1, + 0, + ], + ], + ], + }, + }, + { + id: "landcover", + type: "fill", + source: "swissmaptiles", + "source-layer": "landcover", + minzoom: 5, + filter: [ + "any", + [ + "in", + "subclass", + "wood", + "scrub", + "recreation_ground", + "park", + "golf_course", + "allotments", + "plant_nursery", + "forest", + "glacier", + ], + ["==", "class", "sand"], + ], + layout: { visibility: "visible" }, + paint: { + "fill-color": [ + "match", + ["get", "class"], + ["forest", "wood"], + "rgb(186, 210, 172)", + ["ice", "glacier"], + "rgb(205, 232, 244)", + ["wetland"], + "rgb(204, 229, 245)", + ["sand"], + "rgb(240, 218, 188)", + "rgb(215, 224, 209)", + ], + "fill-opacity": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 5, + 0, + 6, + ["match", ["get", "class"], ["ice", "glacier"], 0.3, 0], + 10, + ["match", ["get", "class"], ["ice", "glacier"], 0.2, 0], + 11, + ["match", ["get", "class"], ["ice", "glacier"], 0.2, 0.3], + 14, + ["match", ["get", "class"], ["ice", "glacier"], 0, 0.3], + ], + }, + }, + { + id: "landcover_casing", + type: "line", + source: "swissmaptiles", + "source-layer": "landcover", + minzoom: 10, + filter: [ + "all", + [ + "in", + "subclass", + "wood", + "scrub", + "recreation_ground", + "park", + "golf_course", + "allotments", + "plant_nursery", + "forest", + ], + ], + layout: { visibility: "visible" }, + paint: { + "line-blur": 0.5, + "line-color": "rgb(186, 199, 172)", + "line-opacity": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 12, + 0, + 14, + 1, + ], + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 6, + 0, + 11, + 0.25, + 16, + 0.75, + ], + }, + }, + { + id: "landuse", + type: "fill", + source: "swissmaptiles", + "source-layer": "landuse", + filter: [ + "all", + ["in", "class", "landfill", "cemetery", "quarry", "zoo", "pitch"], + ], + layout: { visibility: "visible" }, + paint: { + "fill-color": [ + "match", + ["get", "class"], + ["pitch"], + "rgb(224,234,221)", + ["landfill", "quarry"], + "rgb(240, 218, 188)", + ["cemetery", "zoo"], + "rgb(215, 224, 209)", + ["parking"], + "rgb(255, 255, 255)", + "rgb(215, 224, 209)", + ], + "fill-opacity": ["match", ["get", "class"], ["pitch"], 1, 0.3], + }, + }, + { + id: "landuse_outline", + type: "line", + source: "swissmaptiles", + "source-layer": "landuse", + filter: ["all", ["in", "class", "cemetery", "zoo", "pitch"]], + layout: { visibility: "visible" }, + paint: { + "line-color": [ + "match", + ["get", "class"], + ["pitch"], + "rgb(130, 130, 130)", + "rgba(186, 199, 172, 1)", + ], + "line-opacity": { + stops: [ + [14, 0], + [15, 1], + ], + }, + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 11, + 0.25, + 16, + 0.75, + ], + }, + }, + { + id: "water_line_intermittent", + type: "line", + source: "swissmaptiles", + "source-layer": "waterway", + minzoom: 12, + filter: ["all", ["==", "intermittent", 1]], + layout: { visibility: "visible" }, + paint: { + "line-blur": 0, + "line-color": "rgba(48, 48, 48, 1)", + "line-dasharray": { + stops: [ + [13, [0.5, 3]], + [14, [0.75, 4.5]], + [15, [1, 6]], + [16, [1.25, 7.5]], + ], + }, + "line-offset": 0, + "line-opacity": { + stops: [ + [13, 0.25], + [16, 0.35], + ], + }, + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 13, + [ + "match", + ["to-string", ["get", "width"]], + ["10", "9", "8"], + 3.5, + ["7", "6", "5"], + 2.5, + ["4", "3"], + 1.5, + ["1", "2"], + 1, + ["match", ["get", "class"], ["river", "canal"], 3.5, 1], + ], + 16, + [ + "match", + ["to-string", ["get", "width"]], + "10", + 5, + "9", + 4.5, + "8", + 4, + "7", + 3.5, + ["6", "5"], + 3, + "4", + 2.5, + "3", + 2, + "2", + 1.5, + "1", + 1, + ["match", ["get", "class"], ["river", "canal"], 5, 1.5], + ], + 20, + [ + "match", + ["to-string", ["get", "width"]], + "10", + 10, + "9", + 9.6, + "8", + 8.9, + "7", + 8.2, + "6", + 7.5, + "5", + 6.8, + "4", + 6.1, + "3", + 5.4, + "2", + 4.7, + "1", + 4, + ["match", ["get", "class"], ["river", "canal"], 10, 4], + ], + ], + }, + }, + { + id: "water_line", + type: "line", + source: "swissmaptiles", + "source-layer": "waterway", + minzoom: 7, + filter: ["all", ["!=", "intermittent", 1]], + layout: { visibility: "visible" }, + paint: { + "line-blur": 0, + "line-color": [ + "interpolate", + ["linear"], + ["zoom"], + 10, + "rgba(138, 195, 229, 1)", + 16, + [ + "match", + ["get", "class"], + ["river", "canal"], + "rgba(160, 205, 236, 1)", + "rgba(140, 185, 226, 1)", + ], + ], + "line-offset": 0, + "line-opacity": 0.7, + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 7, + 1, + 10, + [ + "match", + ["to-string", ["get", "width"]], + ["10", "9", "8", "7", "6"], + 1.5, + ["5", "4", "3", "2", "1"], + 1, + ["match", ["get", "class"], ["river", "canal"], 1.5, 1], + ], + 13, + [ + "match", + ["to-string", ["get", "width"]], + ["10", "9", "8"], + 3.5, + ["7", "6", "5"], + 2.5, + ["4", "3"], + 1.5, + ["1", "2"], + 1, + ["match", ["get", "class"], ["river", "canal"], 3.5, 1], + ], + 16, + [ + "match", + ["to-string", ["get", "width"]], + "10", + 5, + "9", + 4.5, + "8", + 4, + "7", + 3.5, + ["6", "5"], + 3, + "4", + 2.5, + "3", + 2, + "2", + 1.5, + "1", + 1, + ["match", ["get", "class"], ["river", "canal"], 5, 1.5], + ], + 20, + [ + "match", + ["to-string", ["get", "width"]], + "10", + 10, + "9", + 9.6, + "8", + 8.9, + "7", + 8.2, + "6", + 7.5, + "5", + 6.8, + "4", + 6.1, + "3", + 5.4, + "2", + 4.7, + "1", + 4, + ["match", ["get", "class"], ["river", "canal"], 10, 4], + ], + ], + }, + }, + { + id: "water_polygon", + type: "fill", + source: "swissmaptiles", + "source-layer": "water", + layout: { visibility: "visible" }, + paint: { + "fill-color": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 4, + "rgb(209, 228, 240)", + 10, + "rgb(199, 224, 245)", + ], + }, + }, + { + id: "contour_line_water", + type: "line", + metadata: { "maputnik:comment": "color: rgb(191,138,64)" }, + source: "swissmaptiles", + "source-layer": "contour_line", + minzoom: 13, + filter: ["all", ["in", "class", "ice", "water"]], + layout: { visibility: "visible" }, + paint: { + "line-blur": 0.4, + "line-color": "rgb(0,136,208)", + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 13, + ["match", ["get", "class"], ["scree", "ice", "water"], 0.25, 0.45], + 14, + ["match", ["get", "class"], ["scree", "ice", "water"], 0.3, 0.55], + ], + "line-width": [ + "interpolate", + ["exponential", 1], + ["zoom"], + 12, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 13, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 14, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 1, + 0, + ], + 14.5, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 1.5, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 0.75, + 0, + ], + ], + 16, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 1.75, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 1, + 0, + ], + ], + 16.5, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 2, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 10], 0], + 1, + 0, + ], + ], + ], + }, + }, + { + id: "label_contour_line_20_grey", + type: "symbol", + source: "swissmaptiles", + "source-layer": "contour_line", + minzoom: 16, + filter: [ + "all", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + ["!=", ["%", ["to-number", ["get", "ele"]], 100], 0], + ["match", ["get", "class"], ["scree"], true, false], + ], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "line", + "symbol-spacing": 550, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": "{ele} ", + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-justify": "center", + "text-keep-upright": true, + "text-letter-spacing": 0.1, + "text-max-angle": 40, + "text-padding": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 0, + 15, + 12, + 16, + 80, + ], + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": 12, + "text-transform": "none", + visibility: "visible", + }, + paint: { + "text-color": "rgba(64,64,64, 1)", + "text-halo-blur": 0.5, + "text-halo-color": "rgba(238, 238, 238, .8)", + "text-halo-width": 2, + "text-opacity": [ + "step", + ["zoom"], + 0, + 12, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 16, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 0.75, + 0, + ], + ], + }, + }, + { + id: "label_contour_line_20_blue", + type: "symbol", + source: "swissmaptiles", + "source-layer": "contour_line", + minzoom: 16, + filter: [ + "all", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + ["!=", ["%", ["to-number", ["get", "ele"]], 100], 0], + ["match", ["get", "class"], ["ice", "water"], true, false], + ], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "line", + "symbol-spacing": 550, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": "{ele} ", + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-justify": "center", + "text-keep-upright": true, + "text-letter-spacing": 0.1, + "text-max-angle": 40, + "text-padding": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 0, + 15, + 12, + 16, + 80, + ], + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": 12, + "text-transform": "none", + visibility: "visible", + }, + paint: { + "text-color": "rgba(0,136,208, 1)", + "text-halo-blur": 0.5, + "text-halo-color": "rgba(238, 238, 238, .8)", + "text-halo-width": 2, + "text-opacity": [ + "step", + ["zoom"], + 0, + 12, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 16, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 0.75, + 0, + ], + ], + }, + }, + { + id: "label_contour_line_20_brown", + type: "symbol", + source: "swissmaptiles", + "source-layer": "contour_line", + minzoom: 16, + filter: [ + "all", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + ["!=", ["%", ["to-number", ["get", "ele"]], 100], 0], + ["match", ["get", "class"], ["land"], true, false], + ], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "line", + "symbol-spacing": 550, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": "{ele} ", + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-justify": "center", + "text-keep-upright": true, + "text-letter-spacing": 0.1, + "text-max-angle": 40, + "text-padding": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 0, + 15, + 12, + 16, + 80, + ], + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": 12, + "text-transform": "none", + visibility: "visible", + }, + paint: { + "text-color": "rgba(185,132,58, 1)", + "text-halo-blur": 0.5, + "text-halo-color": "rgba(238, 238, 238, .8)", + "text-halo-width": 2, + "text-opacity": [ + "step", + ["zoom"], + 0, + 12, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 16, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 0.75, + 0, + ], + ], + }, + }, + { + id: "label_contour_line_100_grey", + type: "symbol", + source: "swissmaptiles", + "source-layer": "contour_line", + minzoom: 14, + filter: [ + "all", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + ["match", ["get", "class"], ["scree"], true, false], + ], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "line", + "symbol-spacing": { + stops: [ + [14, 250], + [16, 450], + ], + }, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": "{ele} ", + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-justify": "center", + "text-keep-upright": true, + "text-letter-spacing": 0.1, + "text-max-angle": 35, + "text-padding": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 0, + 15, + 12, + 16, + 80, + ], + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 14, + 10.5, + 16, + 14, + ], + "text-transform": "none", + visibility: "visible", + }, + paint: { + "text-color": "rgba(64,64,64, 1)", + "text-halo-blur": 0.5, + "text-halo-color": "rgba(238, 238, 238, 0.8)", + "text-halo-width": 2, + "text-opacity": [ + "step", + ["zoom"], + 0, + 12, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 16, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 0.75, + 0, + ], + ], + }, + }, + { + id: "label_contour_line_100_blue", + type: "symbol", + source: "swissmaptiles", + "source-layer": "contour_line", + minzoom: 14, + filter: [ + "all", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + ["match", ["get", "class"], ["ice", "water"], true, false], + ], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "line", + "symbol-spacing": { + stops: [ + [14, 250], + [16, 450], + ], + }, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": "{ele} ", + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-justify": "center", + "text-keep-upright": true, + "text-letter-spacing": 0.1, + "text-max-angle": 35, + "text-padding": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 0, + 15, + 12, + 16, + 80, + ], + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 14, + 10.5, + 16, + 14, + ], + "text-transform": "none", + visibility: "visible", + }, + paint: { + "text-color": "rgba(0,136,208, 1)", + "text-halo-blur": 0.5, + "text-halo-color": "rgba(238, 238, 238, 0.8)", + "text-halo-width": 2, + "text-opacity": [ + "step", + ["zoom"], + 0, + 12, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 16, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 0.75, + 0, + ], + ], + }, + }, + { + id: "label_contour_line_100_brown", + type: "symbol", + source: "swissmaptiles", + "source-layer": "contour_line", + minzoom: 14, + filter: [ + "all", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + ["match", ["get", "class"], ["land"], true, false], + ], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "line", + "symbol-spacing": { + stops: [ + [14, 250], + [16, 450], + ], + }, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": "{ele} ", + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-justify": "center", + "text-keep-upright": true, + "text-letter-spacing": 0.1, + "text-max-angle": 35, + "text-padding": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 0, + 15, + 12, + 16, + 80, + ], + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 14, + 10.5, + 16, + 14, + ], + "text-transform": "none", + visibility: "visible", + }, + paint: { + "text-color": "rgba(185,132,58, 1)", + "text-halo-blur": 0.5, + "text-halo-color": "rgba(238, 238, 238, 0.8)", + "text-halo-width": 2, + "text-opacity": [ + "step", + ["zoom"], + 0, + 12, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 100], 0], + 0.75, + 0, + ], + 16, + [ + "case", + ["==", ["%", ["to-number", ["get", "ele"]], 20], 0], + 0.75, + 0, + ], + ], + }, + }, + { + id: "water_outline", + type: "line", + source: "swissmaptiles", + "source-layer": "water", + filter: ["all", ["!=", "class", "ocean"]], + layout: { visibility: "visible" }, + paint: { + "line-blur": 0.5, + "line-color": "rgba(133, 189, 224, 1)", + "line-opacity": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 0, + 0, + 8, + 1, + 14, + 0, + ], + "line-width": 0.5, + }, + }, + { + id: "pattern_landcover_vineyard", + type: "fill", + source: "swissmaptiles", + "source-layer": "landcover", + minzoom: 13, + filter: ["all", ["==", "subclass", "vineyard"]], + paint: { + "fill-opacity": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 13, + 0, + 13.1, + 0.6, + 17, + 1, + ], + "fill-pattern": "vinyard_green", + }, + }, + { + id: "pattern_landcover_wetlands", + type: "fill", + source: "swissmaptiles", + "source-layer": "landcover", + minzoom: 13, + filter: ["all", ["==", "class", "wetland"]], + paint: { + "fill-antialias": true, + "fill-color": "#000000", + "fill-opacity": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 13, + 0, + 13.2, + 0.4, + 17, + 1, + ], + "fill-pattern": "wetland_blue", + }, + }, + { + id: "pattern_landcover_orchard", + type: "fill", + source: "swissmaptiles", + "source-layer": "landcover", + minzoom: 13, + filter: ["all", ["==", "subclass", "orchard"]], + paint: { + "fill-opacity": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 13, + 0, + 13.2, + 0.8, + 17, + 1, + ], + "fill-pattern": "orchard_green", + }, + }, + { + id: "park", + type: "line", + source: "swissmaptiles", + "source-layer": "park", + minzoom: 7, + filter: ["all", ["in", "class", "national_park"]], + paint: { + "line-color": "rgba(171, 197, 159, 1)", + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 7, + 0, + 8, + 1, + 13, + 1, + 14, + 0.6, + ], + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 9, + 1.5, + 15, + 8, + 18, + 12, + ], + }, + }, + { + id: "boundary_disputed", + type: "line", + source: "swissmaptiles", + "source-layer": "boundary", + minzoom: 0, + filter: [ + "all", + ["in", "admin_level", 2, 4], + ["!=", "maritime", 1], + ["==", "disputed", 1], + ["==", "$type", "LineString"], + ], + layout: { + "line-cap": "square", + "line-join": "miter", + visibility: "visible", + }, + paint: { + "line-blur": 1, + "line-color": { + stops: [ + [6, "hsl(300, 55%, 80%)"], + [9, "hsl(315, 40%, 85%)"], + ], + }, + "line-dasharray": [1.5, 2.5], + "line-opacity": { + stops: [ + [13, 1], + [14, 0.7], + ], + }, + "line-width": [ + "interpolate", + ["linear"], + ["zoom"], + 2, + ["match", ["get", "admin_level"], 2, 1, 0], + 3, + ["match", ["get", "admin_level"], 2, 2, 1], + 7, + ["match", ["get", "admin_level"], 2, 4, 1.5], + 18, + ["match", ["get", "admin_level"], 2, 16, 10], + ], + }, + }, + { + id: "boundary", + type: "line", + source: "swissmaptiles", + "source-layer": "boundary", + minzoom: 0, + filter: [ + "all", + ["in", "admin_level", 2, 4], + ["!=", "maritime", 1], + ["!=", "disputed", 1], + ["==", "$type", "LineString"], + ], + layout: { + "line-cap": ["literal", "round"], + "line-join": ["literal", "miter"], + visibility: "visible", + }, + paint: { + "line-blur": 1, + "line-color": { + stops: [ + [6, BORDER_COLOR.lowZoom], + [9, BORDER_COLOR.highZoom], + ], + }, + "line-opacity": { + stops: [ + [13, 1], + [14, 0.8], + ], + }, + "line-width": [ + "interpolate", + ["linear"], + ["zoom"], + 2, + ["match", ["get", "admin_level"], 2, 1, 0], + 3, + ["match", ["get", "admin_level"], 2, 2, 1], + 7, + ["match", ["get", "admin_level"], 2, 3, 1], + 18, + ["match", ["get", "admin_level"], 2, 16, 10], + ], + }, + }, + { + id: "tunnel_public_transport", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 8, + filter: [ + "all", + ["==", "brunnel", "tunnel"], + ["in", "class", "rail", "transit", "cable_car", "gondola"], + ["==", "$type", "LineString"], + ], + layout: { + "line-cap": "butt", + "line-join": "miter", + visibility: "visible", + }, + paint: { + "line-blur": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 18, + 0.4, + ], + "line-color": { + stops: [ + [7, "rgba(255, 50, 50, 1)"], + [15, "rgba(255, 80, 80, 1)"], + ], + }, + "line-dasharray": { + stops: [ + [13, [4, 2.5]], + [14, [6, 3.75]], + [15, [10, 6.25]], + [16, [14, 8.75]], + ], + }, + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + 0, + 9, + ["match", ["get", "class"], ["rail"], 0.8, 0], + 13, + [ + "match", + ["get", "subclass"], + ["rail", "subway", "funicular", "narrow_gauge"], + 0.8, + 0, + ], + 14, + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge", "funicular", "subway"], + ["match", ["get", "service"], ["yard", "siding"], 0, 0.8], + 0, + ], + 14.5, + 0.8, + ], + "line-width": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 0.2, 0.75], + 0.2, + ], + 0.2, + ], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 0.1, 1.25], + 1, + ], + ["cable_car"], + 1, + 0.75, + ], + 18, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 1, 2], + 2, + ], + ["cable_car"], + 2, + 1.5, + ], + ], + }, + }, + { + id: "tunnel_road", + type: "line", + metadata: { "maputnik:comment": "casing color for motorway is brown" }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 7, + filter: [ + "all", + ["==", "brunnel", "tunnel"], + [ + "!in", + "class", + "rail", + "ferry", + "transit", + "cable_car", + "gondola", + "path", + ], + ["==", "$type", "LineString"], + ], + layout: { + "line-cap": "butt", + "line-join": "miter", + visibility: "visible", + }, + paint: { + "line-blur": [ + "interpolate", + ["linear"], + ["zoom"], + 7, + ["literal", 3], + 8, + ["literal", 1], + 9, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary"], + 0.4, + 3, + ], + 10, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "secondary"], + 0.4, + 3, + ], + 11, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "secondary"], + 0.4, + 3, + ], + 12, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "secondary", "tertiary"], + 0.4, + 3, + ], + 13, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "secondary", "tertiary"], + 0.4, + ["minor"], + 1, + 3, + ], + 15, + 0.4, + ], + "line-color": "rgba(170, 170, 170, 1)", + "line-dasharray": { + stops: [ + [13, [3, 1.875]], + [14, [4, 2.5]], + [15, [5, 3.125]], + [16, [6, 3.75]], + ], + }, + "line-offset": 0, + "line-opacity": 1, + "line-width": [ + "interpolate", + ["linear"], + ["zoom"], + 7, + ["literal", 0], + 8, + ["match", ["get", "class"], ["motorway", "trunk", "primary"], 1, 0], + 9, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary"], + 1.1, + 0, + ], + 10, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "secondary"], + 1.2, + 0, + ], + 11, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "secondary"], + 1.3, + 0, + ], + 12, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "secondary", "tertiary"], + 1.4, + 0, + ], + 13, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + 1.5, + ["primary", "secondary", "tertiary", "minor"], + 1, + 0, + ], + 14, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + 2, + ["primary", "secondary", "tertiary", "minor"], + 1.5, + 0, + ], + 15, + ["match", ["get", "class"], ["motorway", "trunk"], 3, 2], + 20, + ["match", ["get", "class"], ["motorway", "trunk"], 5, 2.5], + ], + }, + }, + { + id: "tunnel_road_path", + type: "line", + metadata: { "maputnik:comment": "casing color for motorway is brown" }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 6, + filter: [ + "all", + ["==", "brunnel", "tunnel"], + ["==", "class", "path"], + ["==", "$type", "LineString"], + ], + layout: { + "line-cap": "butt", + "line-join": "miter", + visibility: "visible", + }, + paint: { + "line-blur": 0.4, + "line-color": "rgba(140, 140, 140, 1)", + "line-dasharray": { + stops: [ + [14, [1, 0.6]], + [15, [1.5, 0.9]], + [16, [2, 1.2]], + [17, [3, 1.8]], + [18, [6, 3.6]], + ], + }, + "line-offset": 0, + "line-opacity": { + stops: [ + [14, 0], + [15, 1], + ], + }, + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 15, + 1.1, + 20, + 3, + ], + }, + }, + { + id: "construct_line", + type: "line", + source: "swissmaptiles", + "source-layer": "construct", + minzoom: 14, + filter: ["all", ["==", "class", "lock"]], + paint: { + "line-blur": 0.4, + "line-color": "hsl(220, 10%, 67%)", + "line-opacity": { + stops: [ + [14, 0], + [15, 1], + ], + }, + "line-width": { + stops: [ + [15, 1], + [18, 4], + ], + }, + }, + }, + { + id: "construct", + type: "fill", + source: "swissmaptiles", + "source-layer": "construct", + minzoom: 13, + filter: ["all", ["!=", "class", "lock"]], + paint: { + "fill-color": [ + "interpolate", + ["exponential", 1], + ["zoom"], + 13, + [ + "match", + ["get", "class"], + "weir", + "hsl(220, 10%, 82%)", + "hsl(220, 10%, 86%)", + ], + 17, + [ + "match", + ["get", "class"], + "weir", + "hsl(220, 10%, 75%)", + "dam", + "hsl(220, 10%, 82%)", + "hsl(220, 10%, 86%)", + ], + ], + "fill-opacity": [ + "interpolate", + ["exponential", 1], + ["zoom"], + 12, + 0, + 13, + ["match", ["get", "class"], "dam", 1, 0], + 14, + ["match", ["get", "class"], "dam", 1, 0], + 15, + 1, + ], + }, + }, + { + id: "aeroway_polygon_casing", + type: "line", + source: "swissmaptiles", + "source-layer": "aeroway", + minzoom: 11, + filter: [ + "all", + ["in", "class", "runway", "taxiway", "apron", "runway_grass"], + ["==", "$type", "Polygon"], + ], + layout: { + "line-cap": "round", + "line-join": "round", + visibility: "visible", + }, + paint: { + "line-blur": 0.4, + "line-color": "rgb(190, 190, 190)", + "line-opacity": 1, + "line-width": { + base: 1.5, + stops: [ + [13, 3], + [15, 4], + [17, 5], + ], + }, + }, + }, + { + id: "aeroway_line_casing", + type: "line", + source: "swissmaptiles", + "source-layer": "aeroway", + minzoom: 11, + filter: ["all", ["==", "$type", "LineString"]], + layout: { + "line-cap": "butt", + "line-join": "miter", + visibility: "visible", + }, + paint: { + "line-blur": 0.4, + "line-color": "rgba(110, 110, 110, 1)", + "line-opacity": 1, + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 11.5, + 0, + 12, + 2.3, + 15, + 11.25, + 20, + 153, + ], + }, + }, + { + id: "road_via_ferrata", + type: "line", + metadata: { + "maputnik:comment": + "cannot be in the same layer as road_casings because dasharray doesn't support expressions", + }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 14, + filter: [ + "all", + ["in", "class", "via_ferrata"], + ["!in", "brunnel", "bridge", "tunnel"], + ["==", "$type", "LineString"], + ], + layout: { + "line-cap": "butt", + "line-join": "bevel", + visibility: "visible", + }, + paint: { + "line-blur": { + stops: [ + [15, 0.1], + [20, 0.4], + ], + }, + "line-color": { + stops: [ + [15, "rgba(20, 20, 20, 1)"], + [18, "rgba(90, 90, 90, 1)"], + ], + }, + "line-dasharray": { + stops: [ + [15, [0.75, 2]], + [16, [1.125, 3]], + [17, [1.5, 4]], + [18, [1.875, 5]], + ], + }, + "line-opacity": { + stops: [ + [14, 0], + [15, 1], + ], + }, + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 15, + 1.1, + 20, + 3, + ], + }, + }, + { + id: "road_path", + type: "line", + metadata: { + "maputnik:comment": + "cannot be in the same layer as road_casings because dasharray doesn't support expressions", + }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 14, + filter: [ + "all", + ["match", ["get", "class"], ["path"], true, false], + [ + "match", + ["get", "brunnel"], + ["bridge", "tunnel"], + ["match", ["get", "subclass"], "covered_bridge", true, false], + true, + ], + ["==", ["geometry-type"], "LineString"], + ], + layout: { + "line-cap": "butt", + "line-join": "bevel", + visibility: "visible", + }, + paint: { + "line-blur": { + stops: [ + [15, 0.1], + [20, 0.4], + ], + }, + "line-color": "rgba(115, 115, 115, 1)", + "line-dasharray": { + stops: [ + [14, [3, 1]], + [15, [6, 2]], + [16, [9, 3]], + [17, [12, 4]], + [18, [15, 5]], + ], + }, + "line-opacity": { + stops: [ + [14, 0], + [15, 1], + ], + }, + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 15, + 1.1, + 20, + 3, + ], + }, + }, + { + id: "building_ln", + type: "line", + source: "swissmaptiles", + "source-layer": "building_ln", + minzoom: 13, + paint: { + "line-blur": 0.4, + "line-color": [ + "match", + ["get", "class"], + "weir", + "rgb(20, 136, 205)", + "rgb(130, 130, 130)", + ], + "line-opacity": ["match", ["get", "class"], "weir", 0.2, 1], + "line-width": { + stops: [ + [13, 0], + [16, 2], + [18, 3], + ], + }, + }, + }, + { + id: "road_casing", + type: "line", + metadata: { "maputnik:comment": "casing color for motorway is brown" }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 7, + filter: [ + "all", + [ + "match", + ["get", "class"], + [ + "cable_car", + "car_ferry", + "chair_lift", + "ferry", + "gondola", + "path", + "rail", + "transit", + "via_ferrata", + ], + false, + true, + ], + [ + "match", + ["get", "brunnel"], + ["bridge", "tunnel"], + ["match", ["get", "subclass"], "covered_bridge", true, false], + true, + ], + ["==", ["geometry-type"], "LineString"], + ], + layout: { + "line-cap": "round", + "line-join": "round", + visibility: "visible", + }, + paint: { + "line-blur": { + stops: [ + [7, 3], + [8, 0.4], + ], + }, + "line-color": [ + "interpolate", + ["exponential", 1.7], + ["zoom"], + 9, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(170, 136, 30)", + "rgb(80, 80, 80)", + ], + 15, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(139, 107, 63)", + "rgb(90, 90, 90)", + ], + ], + "line-offset": 0, + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 7, + ["literal", 0], + 8, + ["match", ["get", "ramp"], 1, 1.5, 3], + 10, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 2.5, 4], + ["trunk"], + 4, + 3, + ], + 12, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 2.5, 5], + ["trunk"], + ["match", ["get", "oneway"], 1, 5, 5], + ["primary"], + 5, + ["secondary"], + 4.5, + ["tertiary"], + 3.25, + 0, + ], + 13, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 3.5, 5.5], + ["trunk"], + ["match", ["get", "oneway"], 1, 5.5, 5.5], + ["primary"], + 5.5, + ["secondary"], + 5, + ["tertiary"], + 4, + ["minor"], + 3, + 0, + ], + 15, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 6.5, 8], + ["trunk"], + ["match", ["get", "oneway"], 1, 8, 9], + ["primary"], + 9, + ["secondary"], + 8, + ["tertiary"], + 7, + ["minor"], + 5, + ["track"], + 1.1, + 4, + ], + 16, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 10, 12], + ["trunk"], + ["match", ["get", "oneway"], 1, 12, 15], + ["primary"], + 15, + ["secondary"], + 13, + ["tertiary"], + 11, + ["minor"], + 9, + ["track"], + 1.1, + 8, + ], + 20, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "rail"], + 120, + ["secondary"], + 115, + ["tertiary"], + 110, + ["minor"], + 100, + ["track"], + 3, + 95, + ], + ], + }, + }, + { + id: "landuse_parking", + type: "fill", + source: "swissmaptiles", + "source-layer": "landuse", + filter: ["all", ["in", "class", "parking"]], + layout: { visibility: "visible" }, + paint: { + "fill-color": "rgba(255, 255, 255, 1)", + "fill-opacity": { + stops: [ + [14, 0], + [15, 1], + ], + }, + }, + }, + { + id: "landuse_parking_outline", + type: "line", + source: "swissmaptiles", + "source-layer": "landuse", + filter: ["all", ["in", "class", "parking"]], + layout: { visibility: "visible" }, + paint: { + "line-color": "rgba(130, 130, 130, 1)", + "line-opacity": { + stops: [ + [14, 0], + [15, 1], + ], + }, + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 11, + 0.25, + 16, + 0.75, + ], + }, + }, + { + id: "road_fill", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 7, + filter: [ + "all", + [ + "match", + ["get", "class"], + [ + "cable_car", + "car_ferry", + "chair_lift", + "ferry", + "gondola", + "path", + "rail", + "track", + "transit", + "via_ferrata", + ], + false, + true, + ], + [ + "match", + ["get", "brunnel"], + ["bridge", "tunnel"], + ["match", ["get", "subclass"], "covered_bridge", true, false], + true, + ], + ["==", ["geometry-type"], "LineString"], + ], + layout: { + "line-cap": "round", + "line-join": "round", + visibility: "visible", + }, + paint: { + "line-blur": { + stops: [ + [8, 0.4], + [14, 0.1], + ], + }, + "line-color": [ + "interpolate", + ["exponential", 1], + ["zoom"], + 9, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(255,230,160)", + "rgb(255,255,255)", + ], + 15, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(255, 224, 138)", + "rgb(255,255,255)", + ], + ], + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 7, + ["literal", 0], + 8, + ["match", ["get", "ramp"], 1, 0.5, 2], + 10, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 1.5, 2.75], + ["trunk"], + 2.75, + 2, + ], + 12, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 1.5, 3.75], + ["trunk"], + ["match", ["get", "oneway"], 1, 3.75, 3.75], + ["primary"], + 3.75, + ["secondary"], + 3.25, + ["tertiary"], + 2.25, + 0, + ], + 13, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 2.75, 4.25], + ["trunk"], + ["match", ["get", "oneway"], 1, 4.25, 4.25], + ["primary"], + 4.25, + ["secondary"], + 3.75, + ["tertiary"], + 2.75, + ["minor"], + 1.75, + 0, + ], + 15, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 5, 6.5], + ["trunk"], + ["match", ["get", "oneway"], 1, 6.5, 7.5], + ["primary"], + 7.5, + ["secondary"], + 6.5, + ["tertiary", "rail"], + 5.5, + ["minor"], + 3.5, + 2.5, + ], + 16, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 8.5, 10.5], + ["trunk"], + ["match", ["get", "oneway"], 1, 10.5, 13.5], + ["primary"], + 13.5, + ["secondary"], + 11.5, + ["tertiary", "rail"], + 9.5, + ["minor"], + 7.5, + 6.5, + ], + 20, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "rail"], + 117, + ["secondary"], + 112, + ["tertiary"], + 107, + ["minor"], + 97, + 92, + ], + ], + }, + }, + { + id: "aeroway_line_fill", + type: "line", + source: "swissmaptiles", + "source-layer": "aeroway", + minzoom: 11, + filter: ["all", ["==", "$type", "LineString"]], + layout: { + "line-cap": "butt", + "line-join": "miter", + visibility: "visible", + }, + paint: { + "line-blur": 0.4, + "line-color": [ + "match", + ["get", "class"], + ["runway_grass"], + "rgb(224,234,221)", + "rgb(255, 255, 255)", + ], + "line-opacity": 1, + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 11, + 0, + 12, + 2, + 15, + 10, + 20, + 150, + ], + }, + }, + { + id: "aeroway_polygon_fill", + type: "fill", + source: "swissmaptiles", + "source-layer": "aeroway", + minzoom: 11, + filter: [ + "all", + ["in", "class", "runway", "taxiway", "apron", "runway_grass"], + ["==", "$type", "Polygon"], + ], + layout: { visibility: "visible" }, + paint: { + "fill-antialias": true, + "fill-color": [ + "match", + ["get", "class"], + ["runway_grass"], + "rgb(224,234,221)", + "rgb(255, 255, 255)", + ], + "fill-opacity": 1, + }, + }, + { + id: "car_ferry", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 9, + filter: ["all", ["==", "class", "car_ferry"]], + layout: { visibility: "visible" }, + paint: { + "line-blur": 0.4, + "line-color": "rgba(105, 187, 218, 1)", + "line-dasharray": { + stops: [ + [12, [6, 2]], + [13, [9, 3]], + [14, [12, 4]], + [15, [15, 5]], + [16, [18, 6]], + ], + }, + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 9, + 0, + 11, + ["match", ["get", "class"], ["car_ferry"], 1, 0], + 12, + ["match", ["get", "class"], ["car_ferry"], 1, 0], + 13, + 1, + ], + "line-width": { + stops: [ + [8, 0.4], + [14, 1], + [18, 2], + ], + }, + }, + }, + { + id: "ferry", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 12, + filter: ["all", ["==", "class", "ferry"]], + layout: { visibility: "visible" }, + paint: { + "line-blur": 0.4, + "line-color": "rgba(105, 187, 218, 1)", + "line-dasharray": { + stops: [ + [12, [3, 1]], + [13, [6, 2]], + [14, [9, 3]], + [15, [12, 4]], + [16, [15, 5]], + ], + }, + "line-opacity": { + stops: [ + [12, 0], + [13, 1], + ], + }, + "line-width": { + stops: [ + [8, 0.4], + [14, 1], + [18, 2], + ], + }, + }, + }, + { + id: "public_transport", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 8, + filter: [ + "all", + ["in", "class", "rail", "transit"], + ["!in", "brunnel", "bridge", "tunnel"], + ], + layout: { visibility: "visible" }, + paint: { + "line-blur": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 18, + 0.4, + ], + "line-color": { + stops: [ + [7, "rgba(255, 50, 50, 1)"], + [15, "rgba(255, 80, 80, 1)"], + ], + }, + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + 0, + 9, + ["match", ["get", "class"], ["rail"], 1, 0], + 12, + ["match", ["get", "class"], ["rail"], 1, 0], + 13, + ["match", ["get", "class"], ["rail"], 1, 0], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge", "funicular"], + ["match", ["get", "service"], ["yard", "siding"], 0, 1], + 0, + ], + 0, + ], + 14.5, + 1, + ], + "line-width": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 0.2, 0.5], + 0.2, + ], + 0.2, + ], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 0.2, 1], + 1, + ], + ["cable_car"], + 1, + 0.75, + ], + 18, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 1.5, 2], + 2, + ], + 1.5, + ], + ], + }, + }, + { + id: "sinkhole", + type: "symbol", + source: "swissmaptiles", + "source-layer": "spot_elevation", + minzoom: 14, + filter: [ + "all", + [ + "in", + "class", + "sinkhole", + "sinkhole_rock", + "sinkhole_scree", + "sinkhole_water", + "sinkhole_ice", + ], + ], + layout: { + "icon-anchor": "bottom", + "icon-image": [ + "match", + ["get", "class"], + "sinkhole", + "arrow_brown", + ["sinkhole_rock", "sinkhole_scree"], + "arrow_grey", + ["sinkhole_ice", "sinkhole_water"], + "arrow_blue", + "", + ], + "icon-offset": [0, 0], + "icon-optional": false, + "icon-padding": 30, + "icon-rotate": 15, + "icon-size": 1, + "symbol-placement": "point", + "text-allow-overlap": false, + "text-anchor": "center", + "text-field": "", + "text-font": [], + "text-ignore-placement": false, + "text-keep-upright": false, + "text-optional": false, + "text-size": 16, + visibility: "visible", + }, + paint: { + "icon-color": "#000000", + "icon-opacity": { + stops: [ + [14, 0], + [15, 0.6], + ], + }, + "text-color": "#000000", + "text-halo-blur": 1, + "text-halo-width": 0, + "text-opacity": 1, + }, + }, + { + id: "building_2d", + type: "fill", + source: "swissmaptiles", + "source-layer": "building", + minzoom: 13, + layout: { visibility: "visible" }, + paint: { + "fill-color": { + stops: [ + [13, "hsl(220, 10%, 82%)"], + [17, "hsl(220, 10%, 75%)"], + ], + }, + "fill-opacity": { + stops: [ + [13, 0], + [13.5, 1], + ], + }, + }, + }, + { + id: "building_2d_casing", + type: "line", + source: "swissmaptiles", + "source-layer": "building", + minzoom: 15, + layout: { visibility: "visible" }, + paint: { + "line-color": "hsl(220, 10%, 67%)", + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 15, + 0, + 16, + 0.5, + 19, + 1, + ], + "line-width": ["interpolate", ["linear"], ["zoom"], 15, 0.2, 18, 1.2], + }, + }, + { + id: "lake_elevation", + type: "symbol", + source: "swissmaptiles", + "source-layer": "spot_elevation", + minzoom: 12, + filter: ["all", ["==", "class", "lake_elevation"]], + layout: { + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-image": [ + "case", + ["has", "lake_depth"], + "arrow_line_blue", + ["==", ["length", ["to-string", ["get", "ele"]]], 3], + "line_blue_short", + "line_blue_long", + ], + "icon-offset": [0, 0], + "icon-optional": false, + "icon-size": 1, + "symbol-placement": "point", + "text-allow-overlap": false, + "text-anchor": "center", + "text-field": [ + "case", + ["has", "lake_depth"], + ["concat", ["get", "ele"], "\n\n", ["get", "lake_depth"]], + ["get", "ele"], + ], + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-justify": "center", + "text-keep-upright": false, + "text-line-height": 1, + "text-offset": [ + "case", + ["has", "lake_depth"], + ["literal", [0.35, -0.5]], + ["literal", [0, -0.5]], + ], + "text-optional": false, + "text-pitch-alignment": "auto", + "text-radial-offset": 0, + "text-rotation-alignment": "auto", + "text-size": ["interpolate", ["linear"], ["zoom"], 14, 10.5, 18, 13], + visibility: "visible", + }, + paint: { + "icon-color": "#000000", + "icon-opacity": 1, + "text-color": "rgba(20, 136, 205, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 12, + 1, + 18, + 2, + ], + "text-opacity": 1, + }, + }, + { + id: "bridge-l1_road_casing", + type: "line", + metadata: { "maputnik:comment": "casing color for motorway is brown" }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 10, + filter: [ + "all", + ["==", "layer", 1], + [ + "!in", + "class", + "rail", + "ferry", + "path", + "transit", + "cable_car", + "gondola", + ], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { + "line-cap": "butt", + "line-join": "round", + visibility: "visible", + }, + paint: { + "line-blur": 0.4, + "line-color": [ + "interpolate", + ["exponential", 1.7], + ["zoom"], + 9, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(170, 136, 30)", + "rgb(80, 80, 80)", + ], + 15, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(139, 107, 63)", + "rgb(90, 90, 90)", + ], + ], + "line-offset": 0, + "line-opacity": 1, + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 10, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 2.5, 4], + ["trunk"], + 4, + 3, + ], + 12, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 2.5, 5], + ["trunk"], + ["match", ["get", "oneway"], 1, 5, 5], + ["primary"], + 5, + ["secondary"], + 4.5, + ["tertiary"], + 3.25, + 0, + ], + 13, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 3.5, 5.5], + ["trunk"], + ["match", ["get", "oneway"], 1, 5.5, 5.5], + ["primary"], + 5.5, + ["secondary"], + 5, + ["tertiary"], + 4, + ["minor"], + 3, + 0, + ], + 15, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 6.5, 8], + ["trunk"], + ["match", ["get", "oneway"], 1, 8, 9], + ["primary"], + 9, + ["secondary"], + 8, + ["tertiary"], + 7, + ["minor"], + 5, + ["track"], + 1.1, + 4, + ], + 16, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 10, 12], + ["trunk"], + ["match", ["get", "oneway"], 1, 12, 15], + ["primary"], + 15, + ["secondary"], + 13, + ["tertiary"], + 11, + ["minor"], + 9, + ["track"], + 1.1, + 8, + ], + 20, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "rail"], + 120, + ["secondary"], + 115, + ["tertiary"], + 110, + ["minor"], + 100, + ["track"], + 3, + 95, + ], + ], + }, + }, + { + id: "bridge-l1_fill", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 10, + filter: [ + "all", + ["==", "layer", 1], + ["!in", "class", "ferry", "cable_car", "gondola"], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { + "line-cap": "butt", + "line-join": "round", + visibility: "visible", + }, + paint: { + "line-blur": { + stops: [ + [8, 0.4], + [14, 0.1], + ], + }, + "line-color": [ + "interpolate", + ["exponential", 1], + ["zoom"], + 9, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(255,230,160)", + ["rail", "path", "track"], + [ + "match", + ["get", "subclass"], + "funicular", + "rgba(243,243,246,0)", + "rgb(243,243,246)", + ], + "rgb(255,255,255)", + "rgb(243,243,246)", + "rgb(255,255,255)", + ], + 15, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(255, 224, 138)", + ["rail", "path", "track"], + [ + "match", + ["get", "subclass"], + "funicular", + "rgba(243,243,246,0)", + "rgb(243,243,246)", + ], + "rgb(255,255,255)", + ], + ], + "line-opacity": 1, + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 10, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 1.5, 2.75], + ["trunk"], + 2.75, + 2, + ], + 12, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 1.5, 3.75], + ["trunk"], + ["match", ["get", "oneway"], 1, 3.75, 3.75], + ["primary"], + 3.75, + ["secondary"], + 3.25, + ["tertiary"], + 2.25, + 0, + ], + 13, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 2.75, 4.25], + ["trunk"], + ["match", ["get", "oneway"], 1, 4.25, 4.25], + ["primary"], + 4.25, + ["secondary"], + 3.75, + ["tertiary"], + 2.75, + ["minor"], + 1.75, + 0, + ], + 15, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 5, 6.5], + ["trunk"], + ["match", ["get", "oneway"], 1, 6.5, 7.5], + ["primary"], + 7.5, + ["secondary"], + 6.5, + ["tertiary", "rail"], + 5.5, + ["minor"], + 3.5, + ["transit", "track", "path"], + 2.5, + 2.5, + ], + 16, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 8.5, 10.5], + ["trunk"], + ["match", ["get", "oneway"], 1, 10.5, 13.5], + ["primary"], + 13.5, + ["secondary"], + 11.5, + ["tertiary", "rail"], + 9.5, + ["minor"], + 7.5, + ["transit", "track", "path"], + 6.5, + 6.5, + ], + 20, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "rail"], + 117, + ["secondary"], + 112, + ["tertiary"], + 107, + ["minor"], + 97, + 92, + ], + ], + }, + }, + { + id: "bridge-l1_road_track", + type: "line", + metadata: { "maputnik:comment": "casing color for motorway is brown" }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 14, + filter: [ + "all", + ["==", "class", "track"], + ["==", "layer", 1], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { + "line-cap": "butt", + "line-join": "round", + visibility: "visible", + }, + paint: { + "line-blur": ["interpolate", ["linear"], ["zoom"], 14, 3, 15, 0.4], + "line-color": { + stops: [ + [9, "rgba(80, 80, 80, 1)"], + [15, "rgba(90, 90, 90, 1)"], + ], + }, + "line-offset": 0, + "line-opacity": 1, + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 14, + 0, + 15, + 1.1, + 16, + 1.1, + 18, + 2, + 20, + 3, + ], + }, + }, + { + id: "bridge-l1_road_path", + type: "line", + metadata: { + "maputnik:comment": + "cannot be in the same layer as road_casings because dasharray doesn't support expressions", + }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 14, + filter: [ + "all", + ["in", "class", "path"], + ["==", "layer", 1], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { + "line-cap": "butt", + "line-join": "bevel", + visibility: "visible", + }, + paint: { + "line-blur": { + stops: [ + [15, 0.1], + [20, 0.4], + ], + }, + "line-color": "rgba(115, 115, 115, 1)", + "line-dasharray": { + stops: [ + [14, [3, 1]], + [15, [6, 2]], + [16, [9, 3]], + [17, [12, 4]], + [18, [15, 5]], + ], + }, + "line-opacity": { + stops: [ + [14, 0], + [15, 1], + ], + }, + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 15, + 1.1, + 20, + 3, + ], + }, + }, + { + id: "bridge-l1_public_transport", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 10, + filter: [ + "all", + ["==", "layer", 1], + ["in", "class", "rail", "transit"], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { "line-cap": "round", visibility: "visible" }, + paint: { + "line-blur": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 18, + 0.4, + ], + "line-color": { + stops: [ + [7, "rgba(255, 50, 50, 1)"], + [15, "rgba(255, 80, 80, 1)"], + ], + }, + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + 0, + 9, + ["match", ["get", "class"], ["rail"], 1, 0], + 12, + ["match", ["get", "class"], ["rail"], 1, 0], + 13, + ["match", ["get", "class"], ["rail"], 1, 0], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge", "funicular"], + ["match", ["get", "service"], ["yard", "siding"], 0, 1], + 0, + ], + 0, + ], + 14.5, + 1, + ], + "line-width": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 0.2, 0.5], + 0.2, + ], + 0.2, + ], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 0.1, 1], + 1, + ], + ["cable_car"], + 1, + 0.75, + ], + 18, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 1.5, 2], + 2, + ], + ["cable_car"], + 2, + 1.5, + ], + ], + }, + }, + { + id: "bridge-l2_road_casing", + type: "line", + metadata: { "maputnik:comment": "casing color for motorway is brown" }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 10, + filter: [ + "all", + [">", "layer", 1], + [ + "!in", + "class", + "rail", + "ferry", + "path", + "transit", + "cable_car", + "gondola", + ], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { + "line-cap": "butt", + "line-join": "round", + visibility: "visible", + }, + paint: { + "line-blur": 0.4, + "line-color": [ + "interpolate", + ["exponential", 1.7], + ["zoom"], + 9, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(170, 136, 30)", + "rgb(80, 80, 80)", + ], + 15, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(139, 107, 63)", + "rgb(90, 90, 90)", + ], + ], + "line-offset": 0, + "line-opacity": 1, + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 10, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 2.5, 4], + ["trunk"], + 4, + 3, + ], + 12, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 2.5, 5], + ["trunk"], + ["match", ["get", "oneway"], 1, 5, 5], + ["primary"], + 5, + ["secondary"], + 4.5, + ["tertiary"], + 3.25, + 0, + ], + 13, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 3.5, 5.5], + ["trunk"], + ["match", ["get", "oneway"], 1, 5.5, 5.5], + ["primary"], + 5.5, + ["secondary"], + 5, + ["tertiary"], + 4, + ["minor"], + 3, + 0, + ], + 15, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 6.5, 8], + ["trunk"], + ["match", ["get", "oneway"], 1, 8, 9], + ["primary"], + 9, + ["secondary"], + 8, + ["tertiary"], + 7, + ["minor"], + 5, + ["track"], + 1.1, + 4, + ], + 16, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 10, 12], + ["trunk"], + ["match", ["get", "oneway"], 1, 12, 15], + ["primary"], + 15, + ["secondary"], + 13, + ["tertiary"], + 11, + ["minor"], + 9, + ["track"], + 1.1, + 8, + ], + 20, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "rail"], + 120, + ["secondary"], + 115, + ["tertiary"], + 110, + ["minor"], + 100, + ["track"], + 3, + 95, + ], + ], + }, + }, + { + id: "bridge-l2_fill", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 10, + filter: [ + "all", + [">", "layer", 1], + ["!in", "class", "ferry", "cable_car", "gondola"], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { + "line-cap": "butt", + "line-join": "round", + visibility: "visible", + }, + paint: { + "line-blur": { + stops: [ + [8, 0.4], + [14, 0.1], + ], + }, + "line-color": [ + "interpolate", + ["exponential", 1], + ["zoom"], + 9, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(255,230,160)", + ["rail", "path", "track"], + [ + "match", + ["get", "subclass"], + "funicular", + "rgba(243,243,246,0)", + "rgb(243,243,246)", + ], + "rgb(255,255,255)", + "rgb(243,243,246)", + "rgb(255,255,255)", + ], + 15, + [ + "match", + ["get", "class"], + ["motorway", "trunk"], + "rgb(255, 224, 138)", + ["rail", "path", "track"], + [ + "match", + ["get", "subclass"], + "funicular", + "rgba(243,243,246,0)", + "rgb(243,243,246)", + ], + "rgb(255,255,255)", + ], + ], + "line-opacity": 1, + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 10, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 1.5, 2.75], + ["trunk"], + 2.75, + 2, + ], + 12, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 1.5, 3.75], + ["trunk"], + ["match", ["get", "oneway"], 1, 3.75, 3.75], + ["primary"], + 3.75, + ["secondary"], + 3.25, + ["tertiary"], + 2.25, + 0, + ], + 13, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 2.75, 4.25], + ["trunk"], + ["match", ["get", "oneway"], 1, 4.25, 4.25], + ["primary"], + 4.25, + ["secondary"], + 3.75, + ["tertiary"], + 2.75, + ["minor"], + 1.75, + 0, + ], + 15, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 5, 6.5], + ["trunk"], + ["match", ["get", "oneway"], 1, 6.5, 7.5], + ["primary"], + 7.5, + ["secondary"], + 6.5, + ["tertiary", "rail"], + 5.5, + ["minor"], + 3.5, + ["transit", "track", "path"], + 2.5, + 2.5, + ], + 16, + [ + "match", + ["get", "class"], + ["motorway"], + ["match", ["get", "ramp"], 1, 8.5, 10.5], + ["trunk"], + ["match", ["get", "oneway"], 1, 10.5, 13.5], + ["primary"], + 13.5, + ["secondary"], + 11.5, + ["tertiary", "rail"], + 9.5, + ["minor"], + 7.5, + ["transit", "track", "path"], + 6.5, + 6.5, + ], + 20, + [ + "match", + ["get", "class"], + ["motorway", "trunk", "primary", "rail"], + 117, + ["secondary"], + 112, + ["tertiary"], + 107, + ["minor"], + 97, + 92, + ], + ], + }, + }, + { + id: "bridge-l2_road_track", + type: "line", + metadata: { "maputnik:comment": "casing color for motorway is brown" }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 14, + filter: [ + "all", + [">", "layer", 1], + ["==", "class", "track"], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { + "line-cap": "butt", + "line-join": "round", + visibility: "visible", + }, + paint: { + "line-blur": ["interpolate", ["linear"], ["zoom"], 14, 3, 15, 0.4], + "line-color": { + stops: [ + [9, "rgba(80, 80, 80, 1)"], + [15, "rgba(90, 90, 90, 1)"], + ], + }, + "line-offset": 0, + "line-opacity": 1, + "line-width": [ + "interpolate", + ["exponential", 2], + ["zoom"], + 14, + 0, + 15, + 1.1, + 16, + 1.1, + 18, + 2, + 20, + 3, + ], + }, + }, + { + id: "bridge-l2_road_path", + type: "line", + metadata: { + "maputnik:comment": + "cannot be in the same layer as road_casings because dasharray doesn't support expressions", + }, + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 14, + filter: [ + "all", + [">", "layer", 1], + ["in", "class", "path"], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { + "line-cap": "butt", + "line-join": "bevel", + visibility: "visible", + }, + paint: { + "line-blur": { + stops: [ + [15, 0.1], + [20, 0.4], + ], + }, + "line-color": "rgba(115, 115, 115, 1)", + "line-dasharray": { + stops: [ + [14, [3, 1]], + [15, [6, 2]], + [16, [9, 3]], + [17, [12, 4]], + [18, [15, 5]], + ], + }, + "line-opacity": { + stops: [ + [14, 0], + [15, 1], + ], + }, + "line-width": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 15, + 1.1, + 20, + 3, + ], + }, + }, + { + id: "bridge-l2_public_transport", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 10, + filter: [ + "all", + [">", "layer", 1], + ["in", "class", "rail", "transit", "cable_car", "gondola"], + ["==", "$type", "LineString"], + ["!=", "subclass", "covered_bridge"], + ], + layout: { "line-cap": "round", visibility: "visible" }, + paint: { + "line-blur": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 18, + 0.4, + ], + "line-color": { + stops: [ + [7, "rgba(255, 50, 50, 1)"], + [15, "rgba(255, 80, 80, 1)"], + ], + }, + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + 0, + 9, + ["match", ["get", "class"], ["rail"], 1, 0], + 12, + ["match", ["get", "class"], ["rail"], 1, 0], + 13, + ["match", ["get", "class"], ["rail"], 1, 0], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge", "funicular"], + ["match", ["get", "service"], ["yard", "siding"], 0, 1], + 0, + ], + 0, + ], + 14.5, + 1, + ], + "line-width": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 0.2, 0.5], + 0.2, + ], + 0.2, + ], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 0.1, 1], + 1, + ], + ["cable_car"], + 1, + 0.75, + ], + 18, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 1.5, 2], + 2, + ], + ["cable_car"], + 2, + 1.5, + ], + ], + }, + }, + { + id: "spot_elevation", + type: "symbol", + source: "swissmaptiles", + "source-layer": "spot_elevation", + minzoom: 14, + filter: [ + "all", + [ + "!in", + "class", + "lake_elevation", + "sinkhole", + "sinkhole_rock", + "sinkhole_scree", + "sinkhole_water", + "sinkhole_ice", + ], + ], + layout: { + "icon-image": [ + "match", + ["get", "class"], + "spot_elevation", + "dot_dark_grey_3", + "", + ], + "icon-offset": [0, 0], + "icon-optional": false, + "icon-padding": 30, + "icon-rotate": 0, + "icon-size": 1, + "symbol-placement": "point", + "text-allow-overlap": false, + "text-anchor": "center", + "text-field": ["get", "ele"], + "text-font": ["Frutiger Neue Regular"], + "text-ignore-placement": false, + "text-keep-upright": false, + "text-line-height": 0.9, + "text-optional": false, + "text-radial-offset": 0.3, + "text-size": ["interpolate", ["linear"], ["zoom"], 14, 10.5, 18, 13], + "text-variable-anchor": [ + "literal", + ["bottom-left", "top-left", "bottom-right", "top-right"], + ], + visibility: "visible", + }, + paint: { + "icon-color": "#000000", + "icon-opacity": 0.8, + "text-color": "rgba(80, 80, 80, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 12, + 1.5, + 18, + 3, + ], + "text-opacity": ["literal", 1], + }, + }, + { + id: "water_name_point_label", + type: "symbol", + source: "swissmaptiles", + "source-layer": "water_name", + filter: ["all", ["==", "$type", "Point"], ["==", "class", "lake"]], + layout: { + "symbol-placement": "point", + "symbol-spacing": 350, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": `{${languageTag}}`, + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-keep-upright": true, + "text-letter-spacing": 0.05, + "text-max-width": 1000, + "text-pitch-alignment": "map", + "text-rotation-alignment": "viewport", + "text-size": ["interpolate", ["linear"], ["zoom"], 10, 10.5, 16, 16], + visibility: "visible", + }, + paint: { + "text-color": "rgba(20, 136, 205, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.7)", + "text-halo-width": 1, + }, + }, + { + id: "waterway_line_label", + type: "symbol", + source: "swissmaptiles", + "source-layer": "waterway", + minzoom: 9, + filter: [ + "all", + ["==", "$type", "LineString"], + ["!=", "intermittent", 1], + ], + layout: { + "symbol-placement": "line", + "symbol-spacing": 650, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": `{${languageTag}}`, + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-keep-upright": true, + "text-letter-spacing": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + 0.1, + 12, + ["match", ["get", "class"], ["river"], 0.4, 0.2], + ], + "text-max-width": 9999, + "text-padding": 0, + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 10, + 10.5, + 16, + [ + "match", + ["to-string", ["get", "width"]], + ["9", "10"], + 18, + ["7", "8"], + 17, + ["5", "6"], + 16, + "4", + 15, + "3", + 14, + "2", + 13, + "1", + 12, + ["match", ["get", "class"], ["river", "canal"], 18, 14], + ], + ], + }, + paint: { + "text-color": [ + "match", + ["get", "intermittent"], + 1, + "rgb(64, 64, 64)", + "rgb(20, 136, 205)", + ], + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": 2, + }, + }, + { + id: "transportation_label", + type: "symbol", + source: "swissmaptiles", + "source-layer": "transportation_name", + minzoom: 13, + filter: ["all", ["==", "$type", "LineString"]], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "line", + "symbol-spacing": [ + "interpolate", + ["linear"], + ["zoom"], + 15, + 200, + 18, + 400, + ], + "symbol-z-order": "auto", + "text-anchor": "center", + "text-field": `{${languageTag}}`, + "text-font": ["Frutiger Neue Condensed Regular"], + "text-keep-upright": true, + "text-letter-spacing": 0.1, + "text-max-angle": 40, + "text-offset": [0, 0], + "text-padding": 2, + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": [ + "interpolate", + ["exponential", 1.5], + ["zoom"], + 14, + ["match", ["get", "class"], ["motorway", "trunk"], 11, 10.5], + 18, + ["match", ["get", "class"], ["motorway", "trunk"], 18, 16], + ], + "text-transform": "none", + visibility: "visible", + }, + paint: { + "text-color": [ + "match", + ["get", "class"], + ["rail", "transit", "cable_car", "gondola", "chair_lift"], + "rgba(255, 50, 50, 1)", + "rgba(60, 60, 70, 1)", + ], + "text-halo-blur": 0.2, + "text-halo-color": [ + "match", + ["get", "class"], + [ + "rail", + "transit", + "cable_car", + "gondola", + "chair_lift", + "motorway", + "trunk", + ], + "rgba(255, 255, 255, 0.6)", + "rgba(255, 255, 255, 0.8)", + ], + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + [ + "match", + ["get", "class"], + ["rail", "transit", "cable_car", "gondola", "chair_lift"], + 1, + 1.5, + ], + 20, + 3, + ], + }, + }, + { + id: "aerialway", + type: "line", + source: "swissmaptiles", + "source-layer": "transportation", + minzoom: 12, + filter: ["all", ["in", "class", "cable_car", "gondola", "chair_lift"]], + layout: { visibility: "visible" }, + paint: { + "line-blur": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 14, + [ + "match", + ["get", "class"], + ["rail"], + [ + "match", + ["get", "subclass"], + ["rail", "narrow_gauge"], + ["match", ["get", "service"], ["yard", "siding"], 2.5, 0.6], + 0.6, + ], + 0.6, + ], + 18, + 0.4, + ], + "line-color": { + stops: [ + [7, "rgba(255, 50, 50, 1)"], + [15, "rgba(255, 80, 80, 1)"], + ], + }, + "line-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 12, + 0, + 13, + ["match", ["get", "class"], ["cable_car", "gondola"], 1, 0], + 14, + [ + "match", + ["get", "class"], + ["cable_car", "gondola", "chair_lift"], + 1, + 0, + ], + ], + "line-width": [ + "interpolate", + ["linear"], + ["zoom"], + 8, + 0.2, + 14, + ["match", ["get", "class"], ["cable_car"], 1, 0.75], + 18, + ["match", ["get", "class"], ["cable_car"], 2, 1.5], + ], + }, + }, + { + id: "road_number", + type: "symbol", + source: "swissmaptiles", + "source-layer": "transportation_name", + minzoom: 11, + filter: [ + "all", + ["in", "class", "motorway", "trunk", "primary"], + ["has", "ref"], + ["<=", "ref_length", 12], + ["==", "$type", "LineString"], + ], + layout: { + "icon-allow-overlap": false, + "icon-ignore-placement": false, + "icon-image": "box_white_grey_casing_{ref_length}", + "icon-keep-upright": false, + "icon-offset": [0, -1.3], + "icon-optional": false, + "icon-padding": 2, + "icon-pitch-alignment": "viewport", + "icon-rotation-alignment": "viewport", + "icon-size": 1, + "icon-text-fit": "none", + "symbol-avoid-edges": false, + "symbol-placement": "line", + "symbol-spacing": ["step", ["zoom"], 300, 10, 600, 14, 800], + "symbol-z-order": "auto", + "text-anchor": "center", + "text-field": ["get", "ref"], + "text-font": ["Frutiger Neue Condensed Bold"], + "text-justify": "center", + "text-keep-upright": true, + "text-letter-spacing": 0, + "text-optional": false, + "text-pitch-alignment": "viewport", + "text-rotation-alignment": "viewport", + "text-size": 10.5, + visibility: "visible", + }, + paint: { + "icon-opacity": 1, + "text-color": "rgba(64, 64, 64, 1)", + "text-halo-blur": 0, + "text-halo-color": "rgba(0, 0, 0, 0)", + "text-halo-width": 0, + "text-opacity": 1, + }, + }, + { + id: "area_name_glacier_point_label", + type: "symbol", + source: "swissmaptiles", + "source-layer": "area_name", + minzoom: 14, + filter: [ + "all", + ["==", "$type", "Point"], + ["in", "subclass", "glacier"], + ], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "point", + "symbol-spacing": { + stops: [ + [12, 250], + [14, 550], + ], + }, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": `{${languageTag}}`, + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-keep-upright": true, + "text-letter-spacing": 0.15, + "text-max-width": 99999, + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": ["interpolate", ["linear"], ["zoom"], 10, 11, 16, 20], + }, + paint: { + "text-color": "rgba(55, 146, 201, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": 1, + }, + }, + { + id: "area_name_glacier_line_label", + type: "symbol", + source: "swissmaptiles", + "source-layer": "area_name", + minzoom: 12, + filter: [ + "all", + ["==", "$type", "LineString"], + ["in", "subclass", "glacier"], + ], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "line-center", + "symbol-spacing": { + stops: [ + [12, 250], + [14, 550], + ], + }, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": `{${languageTag}}`, + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-keep-upright": true, + "text-letter-spacing": { + stops: [ + [10, 0.15], + [12, 0.3], + ], + }, + "text-max-width": 99999, + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": ["interpolate", ["linear"], ["zoom"], 10, 11, 16, 20], + }, + paint: { + "text-color": "rgba(55, 146, 201, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": 1, + }, + }, + { + id: "poi_rank3", + type: "symbol", + source: "swissmaptiles", + "source-layer": "poi", + minzoom: 15, + filter: [ + "all", + [ + "match", + ["get", "class"], + [ + "allottments", + "attraction", + "aerialway", + "bus", + "building", + "cave", + "entrance", + "garden", + "museum", + "place_of_worship", + "railway", + "survey_point", + "tower", + "wastewater_plant", + "waterfall", + ], + true, + false, + ], + [ + "match", + ["get", "subclass"], + [ + "allottments", + "attraction", + "bus_stop", + "cave", + "building", + "garden", + "halt", + "museum", + "observation", + "station", + "subway_entrance", + "survey_point", + "tram_stop", + "wastewater_plant", + "waterfall", + "", + ], + true, + false, + ], + ], + layout: { + "icon-allow-overlap": false, + "icon-ignore-placement": false, + "icon-image": [ + "match", + ["get", "subclass"], + ["tram_stop", "bus_stop", "halt", "station", "subway_entrance"], + "dot_red", + "waterfall", + "waterfall_blue", + "observation", + "observation_tower_grey", + "survey_point", + "dot_dark_grey_4", + "", + ], + "icon-optional": false, + "icon-rotate": ["to-number", ["get", "direction"]], + "icon-rotation-alignment": "map", + "icon-size": 1, + "text-anchor": [ + "match", + ["get", "subclass"], + [ + "halt", + "tram_stop", + "bus_stop", + "station", + "subway_entrance", + "survey_point", + ], + "bottom-left", + ["waterfall", "observation"], + "left", + "center", + ], + "text-field": ["get", languageTag], + "text-font": ["Frutiger Neue Condensed Regular"], + "text-justify": "left", + "text-max-width": 10, + "text-offset": [ + "match", + ["get", "subclass"], + "observation", + ["literal", [0.5, 0.2]], + "waterfall", + ["literal", [0.5, 0.1]], + ["literal", [0.4, 0.1]], + ], + "text-optional": false, + "text-padding": 2, + "text-size": ["interpolate", ["linear"], ["zoom"], 14, 12, 18, 18], + visibility: "visible", + }, + paint: { + "icon-opacity": ["case", ["has", "name"], 1, 0], + "text-color": [ + "match", + ["get", "subclass"], + ["halt", "tram_stop", "bus_stop", "station", "subway_entrance"], + "rgba(255, 50, 50, 1)", + "waterfall", + "rgba(20, 136, 205, 1)", + "rgba(48, 48, 48, 1)", + ], + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 1, + 17, + 2, + ], + "text-opacity": [ + "step", + ["zoom"], + 0, + 15, + ["match", ["get", "class"], "college", 0, 1], + 16, + 1, + ], + }, + }, + { + id: "poi_rank2", + type: "symbol", + source: "swissmaptiles", + "source-layer": "poi", + minzoom: 13, + filter: [ + "any", + [ + "match", + ["get", "class"], + [ + "cemetery", + "tower", + "dam", + "ferry_terminal", + "funicular", + "attraction", + "fuel", + "golf", + "golf_course", + "horse_racing", + "military", + "monastery", + "park", + "pitch", + "prison", + "ruins", + "sports_centre", + "stadium", + "swimming_pool", + "power", + "weir", + "zoo", + ], + true, + false, + ], + ["match", ["get", "subclass"], "camp_site", true, false], + ], + layout: { + "icon-allow-overlap": false, + "icon-ignore-placement": false, + "icon-image": [ + "step", + ["zoom"], + [ + "match", + ["get", "subclass"], + "church_tower", + "dot_circle_dark_grey_8", + ["golf_course", "golf"], + "golf_grey", + "ferry_terminal", + "dot_blue", + "funicular_stop", + "dot_red", + "wind_turbine", + "windturbine_grey", + "communications_tower", + "communications_tower_grey", + "", + ], + 15, + [ + "match", + ["get", "subclass"], + ["camp_site", "caravan_site"], + "camping_grey", + "church_tower", + "dot_circle_dark_grey_10", + ["golf_course", "golf"], + "golf_grey", + "ferry_terminal", + "dot_blue", + "funicular_stop", + "dot_red", + "wind_turbine", + "windturbine_grey", + "communications_tower", + "communications_tower_grey", + "", + ], + 16, + [ + "match", + ["get", "subclass"], + ["camp_site", "caravan_site"], + "camping_grey", + "church_tower", + "dot_circle_dark_grey_12", + ["golf_course", "golf"], + "golf_grey", + "ferry_terminal", + "dot_blue", + "funicular_stop", + "dot_red", + "hospital", + "hospital_grey", + "wind_turbine", + "windturbine_grey", + "communications_tower", + "communications_tower_grey", + "", + ], + ], + "icon-offset": [0, 0], + "icon-optional": false, + "icon-size": 1, + "text-anchor": [ + "match", + ["get", "class"], + ["monastery"], + "left", + [ + "match", + ["get", "subclass"], + [ + "caravan_site", + "camp_site", + "church_tower", + "golf_course", + "golf", + "hospital", + "communications_tower", + ], + "left", + ["ferry_terminal", "funicular_stop"], + "bottom-left", + "center", + ], + ], + "text-field": ["get", languageTag], + "text-font": ["Frutiger Neue Condensed Regular"], + "text-justify": "left", + "text-letter-spacing": ["match", ["get", "class"], ["park"], 0.05, 0], + "text-max-width": 10, + "text-offset": [ + "match", + ["get", "subclass"], + ["ferry_terminal", "funicular_stop"], + ["literal", [0.4, 0.1]], + ["literal", [0.8, 0.1]], + ], + "text-optional": true, + "text-size": ["interpolate", ["linear"], ["zoom"], 14, 12, 18, 18], + visibility: "visible", + }, + paint: { + "icon-opacity": [ + "step", + ["zoom"], + 0, + 13, + ["match", ["get", "subclass"], "wind_turbine", 0, 0], + 14, + [ + "match", + ["get", "class"], + ["place_of_worship"], + 1, + [ + "match", + ["get", "subclass"], + [ + "wind_turbine", + "caravan_site", + "camp_site", + "ferry_terminal", + "funicular_stop", + "golf_course", + "golf", + "cemetery", + "stadium", + "park", + ], + 1, + 0, + ], + ], + 15, + 1, + ], + "text-color": [ + "match", + ["get", "subclass"], + "ferry_terminal", + "rgba(20, 136, 205, 1)", + "funicular_stop", + "rgba(255, 50, 50, 1)", + "weir", + "rgba(20, 136, 205, 1)", + "rgba(48, 48, 48, 1)", + ], + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 1, + 17, + 2, + ], + "text-opacity": [ + "step", + ["zoom"], + 0, + 14, + [ + "match", + ["get", "class"], + [ + "ferry_terminal", + "funicular", + "golf", + "golf_course", + "cemetery", + "ruins", + "stadium", + "park", + "pitch", + ], + 1, + 0, + ], + 15, + [ + "match", + ["get", "class"], + [ + "campsite", + "ferry_terminal", + "funicular", + "golf", + "golf_course", + "cemetery", + "stadium", + "park", + "pitch", + "place_of_worship", + "sports_centre", + "zoo", + ], + 1, + 0, + ], + 16, + [ + "match", + ["get", "class"], + [ + "campsite", + "ferry_terminal", + "funicular", + "golf", + "golf_course", + "cemetery", + "stadium", + "park", + "pitch", + "place_of_worship", + "sports_centre", + "zoo", + ], + 1, + 0, + ], + 17, + 1, + ], + }, + }, + { + id: "peaks_other", + type: "symbol", + source: "swissmaptiles", + "source-layer": "mountain_peak", + minzoom: 15, + maxzoom: 24, + filter: [ + "match", + ["get", "class"], + ["rocky_knoll", "saddle"], + true, + false, + ], + layout: { + "icon-allow-overlap": false, + "icon-anchor": "center", + "icon-ignore-placement": false, + "icon-image": "dot_dark_grey_3", + "icon-offset": [0, 0], + "icon-optional": false, + "icon-padding": 0, + "icon-pitch-alignment": "auto", + "icon-rotation-alignment": "auto", + "icon-size": 1, + "symbol-placement": "point", + "symbol-z-order": ["literal", "auto"], + "text-allow-overlap": false, + "text-anchor": "center", + "text-field": [ + "format", + ["get", languageTag], + {}, + "\n", + {}, + ["get", "ele"], + { "font-scale": 0.75 }, + ], + "text-font": ["Frutiger Neue Regular"], + "text-ignore-placement": false, + "text-justify": "auto", + "text-letter-spacing": 0.025, + "text-line-height": 1.15, + "text-max-width": 8, + "text-offset": [0, 0], + "text-optional": false, + "text-padding": 2, + "text-radial-offset": 0.3, + "text-size": [ + "interpolate", + ["linear"], + ["zoom"], + 10, + [ + "case", + ["<=", 4000, ["get", "ele"]], + 14, + ["<=", 3000, ["get", "ele"]], + 13, + ["<=", 2000, ["get", "ele"]], + 12, + 11, + ], + 18, + [ + "case", + ["<=", 4000, ["get", "ele"]], + 23, + ["<=", 3000, ["get", "ele"]], + 22, + ["<=", 2000, ["get", "ele"]], + 21, + 20, + ], + ], + "text-variable-anchor": [ + "literal", + ["bottom-left", "top-left", "bottom-right", "top-right"], + ], + visibility: "visible", + }, + paint: { + "icon-color": "rgba(0, 0, 0, 1)", + "icon-halo-blur": 0, + "icon-halo-color": "rgba(255, 255, 255, 1)", + "icon-halo-width": 0, + "icon-opacity": 1, + "text-color": "rgba(48, 48, 48, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 12, + 1.5, + 18, + 3, + ], + "text-opacity": 1, + }, + }, + { + id: "peaks_rank3+", + type: "symbol", + source: "swissmaptiles", + "source-layer": "mountain_peak", + minzoom: 14, + maxzoom: 24, + filter: [ + "all", + [">=", "rank", 3], + ["!in", "class", "rocky_knoll", "saddle", "mountain_pass"], + ], + layout: { + "icon-allow-overlap": false, + "icon-anchor": "center", + "icon-ignore-placement": false, + "icon-image": [ + "step", + ["zoom"], + "", + 10, + "dot_dark_grey_4", + 14, + "dot_dark_grey_6", + 18, + "dot_dark_grey_8", + ], + "icon-offset": [0, 0], + "icon-optional": false, + "icon-padding": 0, + "icon-pitch-alignment": "auto", + "icon-rotation-alignment": "auto", + "icon-size": 1, + "symbol-placement": "point", + "symbol-z-order": ["literal", "auto"], + "text-allow-overlap": false, + "text-anchor": "bottom-left", + "text-field": [ + "format", + ["get", languageTag], + {}, + "\n", + {}, + ["get", "ele"], + { "font-scale": 0.75 }, + ], + "text-font": ["Frutiger Neue Regular"], + "text-ignore-placement": false, + "text-justify": "auto", + "text-letter-spacing": 0.025, + "text-line-height": 1.15, + "text-max-width": 8, + "text-offset": [0, 0], + "text-optional": false, + "text-padding": 2, + "text-radial-offset": 0.3, + "text-size": [ + "interpolate", + ["linear"], + ["zoom"], + 10, + [ + "case", + ["<=", 4000, ["get", "ele"]], + 14, + ["<=", 3000, ["get", "ele"]], + 13, + ["<=", 2000, ["get", "ele"]], + 12, + 11, + ], + 18, + [ + "case", + ["<=", 4000, ["get", "ele"]], + 23, + ["<=", 3000, ["get", "ele"]], + 22, + ["<=", 2000, ["get", "ele"]], + 21, + 20, + ], + ], + visibility: "visible", + }, + paint: { + "icon-color": "rgba(0, 0, 0, 1)", + "icon-halo-blur": 0, + "icon-halo-color": "rgba(255, 255, 255, 1)", + "icon-halo-width": 0, + "icon-opacity": 1, + "text-color": "rgba(48, 48, 48, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 12, + 1.5, + 18, + 3, + ], + "text-opacity": 1, + }, + }, + { + id: "peaks_rank2", + type: "symbol", + source: "swissmaptiles", + "source-layer": "mountain_peak", + minzoom: 11, + maxzoom: 24, + filter: [ + "all", + ["==", "rank", 2], + ["!in", "class", "rocky_knoll", "saddle", "mountain_pass"], + ], + layout: { + "icon-allow-overlap": false, + "icon-anchor": "center", + "icon-ignore-placement": false, + "icon-image": [ + "step", + ["zoom"], + "", + 10, + "dot_dark_grey_4", + 14, + "dot_dark_grey_6", + 18, + "dot_dark_grey_8", + ], + "icon-offset": [0, 0], + "icon-optional": false, + "icon-padding": 0, + "icon-pitch-alignment": "auto", + "icon-rotation-alignment": "auto", + "icon-size": 1, + "symbol-placement": "point", + "symbol-z-order": ["literal", "auto"], + "text-allow-overlap": false, + "text-anchor": "bottom-left", + "text-field": [ + "format", + ["get", languageTag], + {}, + "\n", + {}, + ["get", "ele"], + { "font-scale": 0.75 }, + ], + "text-font": ["Frutiger Neue Regular"], + "text-ignore-placement": false, + "text-justify": "auto", + "text-letter-spacing": 0.025, + "text-line-height": 1.15, + "text-max-width": 8, + "text-offset": [0, 0], + "text-optional": false, + "text-padding": 2, + "text-radial-offset": 0.3, + "text-size": [ + "interpolate", + ["linear"], + ["zoom"], + 10, + [ + "case", + ["<=", 4000, ["get", "ele"]], + 14, + ["<=", 3000, ["get", "ele"]], + 13, + ["<=", 2000, ["get", "ele"]], + 12, + 11, + ], + 18, + [ + "case", + ["<=", 4000, ["get", "ele"]], + 23, + ["<=", 3000, ["get", "ele"]], + 22, + ["<=", 2000, ["get", "ele"]], + 21, + 20, + ], + ], + visibility: "visible", + }, + paint: { + "icon-color": "rgba(0, 0, 0, 1)", + "icon-halo-blur": 0, + "icon-halo-color": "rgba(255, 255, 255, 1)", + "icon-halo-width": 0, + "icon-opacity": 1, + "text-color": "rgba(48, 48, 48, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 12, + 1.5, + 18, + 3, + ], + "text-opacity": 1, + }, + }, + { + id: "peaks_rank1", + type: "symbol", + source: "swissmaptiles", + "source-layer": "mountain_peak", + minzoom: 9, + maxzoom: 24, + filter: [ + "all", + ["==", "rank", 1], + ["!in", "class", "rocky_knoll", "saddle", "mountain_pass"], + ], + layout: { + "icon-allow-overlap": false, + "icon-anchor": "center", + "icon-ignore-placement": false, + "icon-image": [ + "step", + ["zoom"], + "dot_dark_grey_4", + 14, + "dot_dark_grey_6", + 18, + "dot_dark_grey_8", + ], + "icon-offset": [0, 0], + "icon-optional": false, + "icon-padding": 2, + "icon-pitch-alignment": "auto", + "icon-rotation-alignment": "auto", + "icon-size": 1, + "symbol-placement": "point", + "symbol-z-order": ["literal", "auto"], + "text-allow-overlap": false, + "text-anchor": "bottom-left", + "text-field": [ + "format", + ["get", languageTag], + {}, + "\n", + {}, + ["get", "ele"], + { "font-scale": 0.75 }, + ], + "text-font": ["Frutiger Neue Regular"], + "text-ignore-placement": false, + "text-justify": "auto", + "text-letter-spacing": 0.025, + "text-line-height": 1.15, + "text-max-width": 8, + "text-optional": false, + "text-padding": 10, + "text-radial-offset": 0.3, + "text-size": [ + "interpolate", + ["linear"], + ["zoom"], + 10, + [ + "case", + ["<=", 4000, ["get", "ele"]], + 14, + ["<=", 3000, ["get", "ele"]], + 13, + ["<=", 2000, ["get", "ele"]], + 12, + 11, + ], + 18, + [ + "case", + ["<=", 4000, ["get", "ele"]], + 23, + ["<=", 3000, ["get", "ele"]], + 22, + ["<=", 2000, ["get", "ele"]], + 21, + 20, + ], + ], + visibility: "visible", + }, + paint: { + "icon-color": "rgba(0, 0, 0, 1)", + "icon-halo-blur": 0, + "icon-halo-color": "rgba(255, 255, 255, 1)", + "icon-halo-width": 0, + "icon-opacity": [ + "step", + ["zoom"], + 0, + 9, + ["case", ["<=", 3200, ["get", "ele"]], 1, 0], + 10, + 1, + ], + "text-color": "rgba(48, 48, 48, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 10, + 1.5, + 18, + 3, + ], + "text-opacity": [ + "step", + ["zoom"], + 0, + 9, + ["case", ["<=", 3200, ["get", "ele"]], 1, 0], + 10, + 1, + ], + }, + }, + { + id: "place_other", + type: "symbol", + source: "swissmaptiles", + "source-layer": "place", + minzoom: 11, + maxzoom: 24, + filter: [ + "all", + [ + "!in", + "class", + "continent", + "country", + "state", + "city", + "town", + "village", + "hamlet", + "isolated_dwelling", + ], + ], + layout: { + "icon-optional": false, + "icon-size": 1, + "symbol-sort-key": ["to-number", ["get", "rank"]], + "symbol-z-order": ["literal", "auto"], + "text-anchor": "center", + "text-field": ["get", languageTag], + "text-font": ["Frutiger Neue Condensed Medium"], + "text-justify": "auto", + "text-letter-spacing": 0.025, + "text-max-width": 10, + "text-offset": ["literal", [0.3, 0.2]], + "text-padding": 20, + "text-size": [ + "interpolate", + ["cubic-bezier", 0.5, 0.1, 0.7, 1], + ["zoom"], + 4, + 6, + 16, + 20, + ], + "text-transform": "none", + visibility: "visible", + }, + paint: { + "icon-opacity": [ + "step", + ["zoom"], + 0, + 11, + ["case", [">", 18, ["get", "rank"]], 1, 0], + 13, + 1, + 14, + 0, + ], + "text-color": "rgba(64, 64, 64, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["cubic-bezier", 0, 0.75, 0.25, 1], + ["zoom"], + 12, + 0, + 16, + 2, + ], + "text-opacity": [ + "step", + ["zoom"], + 0, + 11, + ["case", [">", 18, ["get", "rank"]], 1, 0], + 13, + 1, + ], + }, + }, + { + id: "poi_rank1", + type: "symbol", + source: "swissmaptiles", + "source-layer": "poi", + minzoom: 14, + filter: [ + "all", + ["in", "subclass", "castle", "station"], + ["in", "class", "castle", "railway"], + ], + layout: { + "icon-image": [ + "match", + ["get", "subclass"], + "station", + "square_red", + "castle", + "castle_grey", + "", + ], + "icon-size": 1, + "symbol-avoid-edges": true, + "text-anchor": [ + "match", + ["get", "subclass"], + ["castle"], + "left", + "station", + "bottom-left", + "center", + ], + "text-field": ["get", languageTag], + "text-font": ["Frutiger Neue Condensed Regular"], + "text-justify": "left", + "text-max-width": 10, + "text-offset": [ + "match", + ["get", "subclass"], + "station", + ["literal", [0.5, 0.15]], + ["literal", [0.8, 0.15]], + ], + "text-optional": false, + "text-padding": 10, + "text-size": ["interpolate", ["linear"], ["zoom"], 13, 13, 18, 20], + visibility: "visible", + }, + paint: { + "text-color": [ + "match", + ["get", "subclass"], + "station", + "rgba(255, 50, 50, 1)", + "rgba(48, 48, 48, 1)", + ], + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 1, + 17, + 2, + ], + "text-opacity": 1, + }, + }, + { + id: "place_hamlet_isolated_dwelling", + type: "symbol", + source: "swissmaptiles", + "source-layer": "place", + minzoom: 11, + maxzoom: 24, + filter: ["all", ["in", "class", "hamlet", "isolated_dwelling"]], + layout: { + "icon-image": [ + "step", + ["zoom"], + "circle_dark_grey_4", + 12, + "circle_dark_grey_6", + ], + "icon-optional": false, + "icon-size": 1, + "symbol-sort-key": ["to-number", ["get", "rank"]], + "symbol-z-order": ["literal", "auto"], + "text-anchor": ["literal", "bottom-left"], + "text-field": ["get", languageTag], + "text-font": ["Frutiger Neue Condensed Medium"], + "text-justify": "auto", + "text-letter-spacing": 0.025, + "text-max-width": 10, + "text-offset": ["literal", [0.3, 0.2]], + "text-padding": [ + "interpolate", + ["linear"], + ["zoom"], + 10, + 2, + 13, + 2, + 14, + 0, + ], + "text-size": [ + "interpolate", + ["cubic-bezier", 0.5, 0.1, 0.7, 1], + ["zoom"], + 4, + 6, + 16, + 18, + ], + "text-transform": "none", + visibility: "visible", + }, + paint: { + "icon-opacity": [ + "step", + ["zoom"], + 0, + 11, + ["case", [">", 30, ["get", "rank"]], 1, 0], + 13, + ["case", [">", 31, ["get", "rank"]], 1, 0], + 14, + 0, + ], + "text-color": "rgba(64, 64, 64, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["cubic-bezier", 0, 0.75, 0.25, 1], + ["zoom"], + 12, + 0, + 16, + 2, + ], + "text-opacity": [ + "step", + ["zoom"], + 0, + 11, + ["case", [">", 30, ["get", "rank"]], 1, 0], + 13, + ["case", [">", 31, ["get", "rank"]], 1, 0], + 14, + 1, + ], + }, + }, + { + id: "place_village", + type: "symbol", + source: "swissmaptiles", + "source-layer": "place", + minzoom: 7, + maxzoom: 18, + filter: ["all", ["==", "class", "village"]], + layout: { + "icon-image": [ + "step", + ["zoom"], + "circle_dark_grey_4", + 6, + "circle_dark_grey_4", + 8, + "circle_dark_grey_6", + 10, + "circle_dark_grey_8", + 12, + "circle_dark_grey_10", + ], + "icon-optional": false, + "icon-size": 1, + "symbol-sort-key": ["to-number", ["get", "rank"]], + "symbol-z-order": ["literal", "auto"], + "text-anchor": ["literal", "bottom-left"], + "text-field": ["get", languageTag], + "text-font": ["Frutiger Neue Condensed Medium"], + "text-justify": "auto", + "text-letter-spacing": 0.025, + "text-max-width": 10, + "text-offset": ["literal", [0.4, 0.2]], + "text-optional": false, + "text-padding": 20, + "text-size": [ + "interpolate", + ["cubic-bezier", 0.5, 0.1, 0.7, 1], + ["zoom"], + 4, + 6, + 10, + 16, + 16, + 28, + ], + "text-transform": "none", + visibility: "visible", + }, + paint: { + "icon-opacity": ["step", ["zoom"], 1, 13, 0], + "text-color": "rgba(64, 64, 64, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["cubic-bezier", 0, 0.75, 0.25, 1], + ["zoom"], + 12, + 0, + 16, + 2, + ], + "text-opacity": 1, + }, + }, + { + id: "aerodrome_label", + type: "symbol", + source: "swissmaptiles", + "source-layer": "aerodrome_label", + minzoom: 11, + filter: ["all", ["!=", "class", "helipad"]], + layout: { + "icon-anchor": "center", + "icon-image": [ + "match", + ["get", "class"], + "international", + "airplane_large_grey", + "regional", + "airplane_medium_grey", + "other", + "airplane_small_grey", + "helipad", + "helicopter_grey", + "", + ], + "icon-size": ["interpolate", ["linear"], ["zoom"], 11, 0.7, 14, 1], + "text-anchor": "left", + "text-field": ["get", languageTag], + "text-font": ["Frutiger Neue Condensed Regular"], + "text-justify": "center", + "text-offset": [ + "match", + ["get", "class"], + "helipad", + ["literal", [0.9, 0.2]], + ["literal", [0.9, 0]], + ], + "text-padding": 2, + "text-size": [ + "interpolate", + ["linear"], + ["zoom"], + 11, + [ + "match", + ["get", "class"], + "international", + 16, + "regional", + 16, + 12, + ], + 14, + [ + "match", + ["get", "class"], + "international", + 20, + "regional", + 18, + 16, + ], + ], + "text-transform": "none", + }, + paint: { + "icon-opacity": ["literal", 1], + "text-color": "rgba(64, 64, 64, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.8)", + "text-halo-width": [ + "interpolate", + ["linear"], + ["zoom"], + 14, + 1, + 17, + 2, + ], + "text-opacity": 1, + }, + }, + { + id: "water_name_line_label", + type: "symbol", + source: "swissmaptiles", + "source-layer": "water_name", + filter: [ + "all", + ["==", "$type", "LineString"], + ["!=", "class", "lake_part"], + ], + layout: { + "symbol-avoid-edges": false, + "symbol-placement": "line-center", + "symbol-spacing": { + stops: [ + [10, 250], + [13, 950], + ], + }, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": `{${languageTag}}`, + "text-font": ["Frutiger Neue Italic"], + "text-ignore-placement": false, + "text-keep-upright": true, + "text-letter-spacing": 0.15, + "text-max-width": 99999, + "text-padding": 2, + "text-pitch-alignment": "map", + "text-rotation-alignment": "map", + "text-size": ["interpolate", ["linear"], ["zoom"], 10, 14, 16, 24], + }, + paint: { + "text-color": "rgba(20, 136, 205, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": 1, + }, + }, + { + id: "place_town", + type: "symbol", + source: "swissmaptiles", + "source-layer": "place", + minzoom: 6, + maxzoom: 16, + filter: ["all", ["==", "class", "town"]], + layout: { + "icon-image": [ + "step", + ["zoom"], + "circle_dark_grey_4", + 6, + "circle_dark_grey_6", + 8, + "circle_dark_grey_8", + 10, + "circle_dark_grey_10", + 12, + "circle_dark_grey_12", + ], + "icon-optional": false, + "icon-size": 1, + "symbol-placement": "point", + "symbol-sort-key": ["to-number", ["get", "rank"]], + "symbol-z-order": ["literal", "auto"], + "text-anchor": ["literal", "bottom-left"], + "text-field": ["get", languageTag], + "text-font": ["Frutiger Neue Condensed Bold"], + "text-justify": "auto", + "text-letter-spacing": 0.025, + "text-max-width": 10, + "text-offset": ["literal", [0.35, 0.1]], + "text-padding": 10, + "text-size": [ + "interpolate", + ["cubic-bezier", 0.5, 0.1, 0.7, 1], + ["zoom"], + 4, + 8, + 16, + 32, + ], + "text-transform": "uppercase", + visibility: "visible", + }, + paint: { + "icon-opacity": ["step", ["zoom"], 1, 12, 0], + "text-color": "rgba(64, 64, 64, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["cubic-bezier", 0, 0.75, 0.25, 1], + ["zoom"], + 12, + 0, + 16, + 3, + ], + "text-opacity": 1, + }, + }, + { + id: "park_label", + type: "symbol", + source: "swissmaptiles", + "source-layer": "park", + minzoom: 8, + filter: [ + "all", + ["in", "class", "national_park"], + ["==", "$type", "Point"], + ], + layout: { + "symbol-z-order": ["literal", "auto"], + "text-field": `{${languageTag}}`, + "text-font": ["Frutiger Neue Regular"], + "text-padding": ["interpolate", ["linear"], ["zoom"], 10, 2, 14, 10], + "text-size": [ + "interpolate", + ["cubic-bezier", 0.5, 0.1, 0.7, 1], + ["zoom"], + 8, + 14, + 16, + 28, + ], + }, + paint: { + "text-color": "rgba(70, 130, 25, 0.9)", + "text-halo-blur": 1, + "text-halo-color": "rgba(255, 255, 255, 0.8)", + "text-halo-width": 1, + }, + }, + { + id: "area_name_massif_label", + type: "symbol", + source: "swissmaptiles", + "source-layer": "area_name", + minzoom: 11, + filter: ["all", ["==", "$type", "Point"], ["in", "subclass", "massif"]], + layout: { + "symbol-avoid-edges": true, + "symbol-placement": "point", + "symbol-spacing": { + stops: [ + [12, 250], + [14, 550], + ], + }, + "symbol-z-order": "auto", + "text-allow-overlap": false, + "text-field": `{${languageTag}}`, + "text-font": ["Frutiger Neue Regular"], + "text-ignore-placement": false, + "text-keep-upright": true, + "text-letter-spacing": 0.07, + "text-max-width": 99999, + "text-pitch-alignment": "viewport", + "text-rotation-alignment": "viewport", + "text-size": ["interpolate", ["linear"], ["zoom"], 10, 14, 16, 23], + }, + paint: { + "text-color": "rgba(48, 48, 48, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": 1, + }, + }, + { + id: "place_city", + type: "symbol", + source: "swissmaptiles", + "source-layer": "place", + minzoom: 2, + maxzoom: 14, + filter: ["all", ["==", "class", "city"]], + layout: { + "icon-image": [ + "step", + ["zoom"], + "dot_circle_dark_grey_6", + 6, + "dot_circle_dark_grey_8", + 8, + "circle_circle_dark_grey_10", + 10, + "circle_circle_dark_grey_12", + 12, + "circle_circle_dark_grey_12", + ], + "icon-optional": false, + "icon-size": 1, + "symbol-sort-key": ["to-number", ["get", "rank"]], + "symbol-z-order": ["literal", "auto"], + "text-anchor": "bottom-left", + "text-field": ["get", languageTag], + "text-font": ["Frutiger Neue Condensed Bold"], + "text-justify": "auto", + "text-letter-spacing": 0.025, + "text-max-width": 10, + "text-offset": ["literal", [0.35, 0.1]], + "text-padding": 10, + "text-size": [ + "interpolate", + ["cubic-bezier", 0.5, 0.1, 0.7, 1], + ["zoom"], + 1, + 11, + 4, + 12, + 16, + 48, + ], + "text-transform": "uppercase", + visibility: "visible", + }, + paint: { + "icon-opacity": ["step", ["zoom"], 1, 11, 0], + "text-color": "rgba(64, 64, 64, 1)", + "text-halo-blur": 1, + "text-halo-color": "rgba(242, 242, 242, 0.6)", + "text-halo-width": [ + "interpolate", + ["cubic-bezier", 0, 0.75, 0.25, 1], + ["zoom"], + 12, + 0, + 16, + 3, + ], + "text-opacity": 1, + }, + }, + { + id: "place_country", + type: "symbol", + source: "swissmaptiles", + "source-layer": "place", + minzoom: 0, + maxzoom: 7, + filter: ["all", ["in", "class", "country"], ["in", "iso_a2", "CH"]], + layout: { + "text-field": `{${languageTag}}`, + "text-font": ["Frutiger Neue Condensed Regular"], + "text-letter-spacing": 0.12, + "text-max-width": 10, + "text-size": ["interpolate", ["linear"], ["zoom"], 1, 12, 6, 16], + "text-transform": "uppercase", + visibility: "visible", + }, + paint: { + "text-color": "rgba(145, 70, 145, 0.9)", + "text-halo-blur": 1, + "text-halo-color": "rgba(255, 255, 255, 0.8)", + "text-halo-width": 1, + "text-opacity": ["interpolate", ["linear"], ["zoom"], 6, 1, 7, 0], + }, + }, + ], + id: "b484873e-ac8c-45d6-a562-5402ab0f4985", + }; +}; diff --git a/app/charts/map/map-state.tsx b/app/charts/map/map-state.tsx index f68e12f60..c14a9d0fc 100644 --- a/app/charts/map/map-state.tsx +++ b/app/charts/map/map-state.tsx @@ -47,8 +47,7 @@ export interface MapState { chartType: "map"; bounds: Bounds; features: GeoData; - showRelief: boolean; - showWater: boolean; + showBaseLayer: boolean; identicalLayerComponentIris: boolean; areaLayer: { data: Observation[]; @@ -277,8 +276,7 @@ const useMapState = ({ chartType: "map", features, bounds, - showRelief: baseLayer.showRelief, - showWater: baseLayer.showWater, + showBaseLayer: baseLayer.show, identicalLayerComponentIris, areaLayer: { data: areaData, diff --git a/app/charts/map/map.tsx b/app/charts/map/map.tsx index d125ccf96..9bb7a0baf 100644 --- a/app/charts/map/map.tsx +++ b/app/charts/map/map.tsx @@ -1,26 +1,19 @@ import { MapController, WebMercatorViewport } from "@deck.gl/core"; -import { MVTLayer, TileLayer } from "@deck.gl/geo-layers"; -import { BitmapLayer, GeoJsonLayer, ScatterplotLayer } from "@deck.gl/layers"; +import { GeoJsonLayer, ScatterplotLayer } from "@deck.gl/layers"; import DeckGL from "@deck.gl/react"; import React, { useCallback, useMemo, useState } from "react"; +import { StaticMap } from "react-map-gl"; import { Box, Button } from "theme-ui"; import { GeoFeature, GeoPoint } from "../../domain/data"; import { Icon, IconName } from "../../icons"; +import { useLocale } from "../../src"; import { convertHexToRgbArray } from "../shared/colors"; import { useChartState } from "../shared/use-chart-state"; import { useInteraction } from "../shared/use-interaction"; +import { getBaseLayerStyle } from "./get-base-layer-style"; import { MapState } from "./map-state"; import { useMapTooltip } from "./map-tooltip"; -type TileData = { - z: number; - x: number; - y: number; - url: string; - bbox: { west: number; north: number; east: number; south: number }; - signal: { aborted: boolean }; -}; - const MIN_ZOOM = 3; const MAX_ZOOM = 13; @@ -96,13 +89,14 @@ const constrainZoom = ( export const MapComponent = () => { const { - showRelief, - showWater, + showBaseLayer, features, identicalLayerComponentIris, areaLayer, symbolLayer, } = useChartState() as MapState; + const locale = useLocale(); + const [, dispatchInteraction] = useInteraction(); const [, setMapTooltipType] = useMapTooltip(); @@ -157,16 +151,16 @@ export const MapComponent = () => { [areaLayer.hierarchyLevel, features.areaLayer?.shapes] ); + const baseLayerStyle = useMemo(() => getBaseLayerStyle({ locale }), [locale]); + return ( { "default"} > - {showRelief && ( - { - const { - bbox: { west, south, east, north }, - } = props.tile; - - return [ - new BitmapLayer(props, { - data: null, - image: props.data, - bounds: [west, south, east, north], - }), - ]; - }} - /> - )} + {showBaseLayer && } {areaLayer.show && ( <> @@ -276,27 +247,6 @@ export const MapComponent = () => { )} - { - return showWater && d.properties.layerName === "water" - ? [148, 198, 240] - : [148, 198, 240, 0]; - }} - updateTriggers={{ - getFillColor: [showWater], - }} - /> - {symbolLayer.show && ( Base Layer} - active={ - chartConfig.baseLayer.showRelief || - chartConfig.baseLayer.showWater - } + active={chartConfig.baseLayer.show} /> ) : ( ; const BaseLayer = t.type({ - showRelief: t.boolean, - showWater: t.boolean, + show: t.boolean, }); export type BaseLayer = t.TypeOf; const MapFields = t.type({ diff --git a/app/configurator/map/map-chart-options.tsx b/app/configurator/map/map-chart-options.tsx index bbf2f5ab7..a1ab95588 100644 --- a/app/configurator/map/map-chart-options.tsx +++ b/app/configurator/map/map-chart-options.tsx @@ -62,19 +62,11 @@ export const BaseLayersSettings = memo(() => { - diff --git a/app/locales/de/messages.po b/app/locales/de/messages.po index dccbb5451..ac5cc3bdf 100644 --- a/app/locales/de/messages.po +++ b/app/locales/de/messages.po @@ -116,7 +116,7 @@ msgid "button.share" msgstr "Teilen" #: app/configurator/components/ui-helpers.ts:417 -#: app/configurator/map/map-chart-options.tsx:167 +#: app/configurator/map/map-chart-options.tsx:159 msgid "chart.map.layers.area" msgstr "Flächen" @@ -124,11 +124,11 @@ msgstr "Flächen" msgid "chart.map.layers.area.discretization.continuous" msgstr "Kontinuierlich" -#: app/configurator/map/map-chart-options.tsx:264 +#: app/configurator/map/map-chart-options.tsx:256 msgid "chart.map.layers.area.discretization.discrete" msgstr "Diskret" -#: app/configurator/map/map-chart-options.tsx:312 +#: app/configurator/map/map-chart-options.tsx:304 msgid "chart.map.layers.area.discretization.jenks" msgstr "Jenks (Natural Breaks)" @@ -136,7 +136,7 @@ msgstr "Jenks (Natural Breaks)" msgid "chart.map.layers.area.discretization.quantiles" msgstr "Quantile (gleiche Anzahl Werte)" -#: app/configurator/map/map-chart-options.tsx:298 +#: app/configurator/map/map-chart-options.tsx:290 msgid "chart.map.layers.area.discretization.quantize" msgstr "Quantisierung (gleiche Wertebereiche)" @@ -147,12 +147,8 @@ msgid "chart.map.layers.base" msgstr "Basis-Ebene" #: app/configurator/map/map-chart-options.tsx:64 -msgid "chart.map.layers.base.show.relief" -msgstr "Relief anzeigen" - -#: app/configurator/map/map-chart-options.tsx:72 -msgid "chart.map.layers.base.show.water" -msgstr "Seen und Flüsse anzeigen" +msgid "chart.map.layers.base.show" +msgstr "Anzeigen" #: app/configurator/map/map-chart-options.tsx:171 #: app/configurator/map/map-chart-options.tsx:383 @@ -160,7 +156,7 @@ msgid "chart.map.layers.show" msgstr "Ebene anzeigen" #: app/configurator/components/ui-helpers.ts:421 -#: app/configurator/map/map-chart-options.tsx:379 +#: app/configurator/map/map-chart-options.tsx:371 msgid "chart.map.layers.symbol" msgstr "Symbole" @@ -246,8 +242,8 @@ msgid "controls.chart.type.table" msgstr "Tabelle" #: app/configurator/components/ui-helpers.ts:399 -#: app/configurator/map/map-chart-options.tsx:240 -#: app/configurator/map/map-chart-options.tsx:433 +#: app/configurator/map/map-chart-options.tsx:232 +#: app/configurator/map/map-chart-options.tsx:425 msgid "controls.color" msgstr "Farbe" @@ -269,7 +265,7 @@ msgstr "Farbpalette zurücksetzen" msgid "controls.color.palette.sequential" msgstr "Sequentiell" -#: app/configurator/map/map-chart-options.tsx:437 +#: app/configurator/map/map-chart-options.tsx:429 msgid "controls.color.select" msgstr "Farbe auswählen" @@ -289,8 +285,8 @@ msgstr "Gestapelt" msgid "controls.description" msgstr "Beschreibung hinzufügen" -#: app/configurator/map/map-chart-options.tsx:182 -#: app/configurator/map/map-chart-options.tsx:394 +#: app/configurator/map/map-chart-options.tsx:174 +#: app/configurator/map/map-chart-options.tsx:386 msgid "controls.dimension.geographical" msgstr "Geografische Dimension" @@ -321,11 +317,11 @@ msgstr "Alle abwählen" msgid "controls.filters.time.range" msgstr "Zeitspanne" -#: app/configurator/map/map-chart-options.tsx:203 +#: app/configurator/map/map-chart-options.tsx:195 msgid "controls.hierarchy" msgstr "Hierarchie-Ebene" -#: app/configurator/map/map-chart-options.tsx:208 +#: app/configurator/map/map-chart-options.tsx:200 msgid "controls.hierarchy.select" msgstr "Hierarchie-Ebene auswählen" @@ -394,8 +390,8 @@ msgid "controls.language.italian" msgstr "Italienisch" #: app/configurator/components/ui-helpers.ts:391 -#: app/configurator/map/map-chart-options.tsx:222 -#: app/configurator/map/map-chart-options.tsx:415 +#: app/configurator/map/map-chart-options.tsx:214 +#: app/configurator/map/map-chart-options.tsx:407 msgid "controls.measure" msgstr "Messwert" @@ -407,7 +403,7 @@ msgstr "Ein" msgid "controls.option.isNotActive" msgstr "Aus" -#: app/configurator/map/map-chart-options.tsx:244 +#: app/configurator/map/map-chart-options.tsx:236 msgid "controls.scale.type" msgstr "Skalierungstyp" @@ -522,14 +518,14 @@ msgid "controls.select.columnStyle.textStyle" msgstr "Schriftstil" #: app/configurator/components/chart-options-selector.tsx:179 -#: app/configurator/map/map-chart-options.tsx:190 -#: app/configurator/map/map-chart-options.tsx:402 +#: app/configurator/map/map-chart-options.tsx:182 +#: app/configurator/map/map-chart-options.tsx:394 msgid "controls.select.dimension" msgstr "Dimension auswählen" #: app/configurator/components/chart-options-selector.tsx:180 -#: app/configurator/map/map-chart-options.tsx:227 -#: app/configurator/map/map-chart-options.tsx:420 +#: app/configurator/map/map-chart-options.tsx:219 +#: app/configurator/map/map-chart-options.tsx:412 msgid "controls.select.measure" msgstr "Messwert auswählen" diff --git a/app/locales/en/messages.po b/app/locales/en/messages.po index 6d58cf1f8..58aeff5da 100644 --- a/app/locales/en/messages.po +++ b/app/locales/en/messages.po @@ -116,7 +116,7 @@ msgid "button.share" msgstr "Share" #: app/configurator/components/ui-helpers.ts:417 -#: app/configurator/map/map-chart-options.tsx:167 +#: app/configurator/map/map-chart-options.tsx:159 msgid "chart.map.layers.area" msgstr "Areas" @@ -124,11 +124,11 @@ msgstr "Areas" msgid "chart.map.layers.area.discretization.continuous" msgstr "Continuous" -#: app/configurator/map/map-chart-options.tsx:264 +#: app/configurator/map/map-chart-options.tsx:256 msgid "chart.map.layers.area.discretization.discrete" msgstr "Discrete" -#: app/configurator/map/map-chart-options.tsx:312 +#: app/configurator/map/map-chart-options.tsx:304 msgid "chart.map.layers.area.discretization.jenks" msgstr "Jenks (natural breaks)" @@ -136,7 +136,7 @@ msgstr "Jenks (natural breaks)" msgid "chart.map.layers.area.discretization.quantiles" msgstr "Quantiles (equal distribution of values)" -#: app/configurator/map/map-chart-options.tsx:298 +#: app/configurator/map/map-chart-options.tsx:290 msgid "chart.map.layers.area.discretization.quantize" msgstr "Quantize (equal intervals)" @@ -147,12 +147,8 @@ msgid "chart.map.layers.base" msgstr "Base Layer" #: app/configurator/map/map-chart-options.tsx:64 -msgid "chart.map.layers.base.show.relief" -msgstr "Show relief" - -#: app/configurator/map/map-chart-options.tsx:72 -msgid "chart.map.layers.base.show.water" -msgstr "Show water" +msgid "chart.map.layers.base.show" +msgstr "Show" #: app/configurator/map/map-chart-options.tsx:171 #: app/configurator/map/map-chart-options.tsx:383 @@ -160,7 +156,7 @@ msgid "chart.map.layers.show" msgstr "Show layer" #: app/configurator/components/ui-helpers.ts:421 -#: app/configurator/map/map-chart-options.tsx:379 +#: app/configurator/map/map-chart-options.tsx:371 msgid "chart.map.layers.symbol" msgstr "Symbols" @@ -246,8 +242,8 @@ msgid "controls.chart.type.table" msgstr "Table" #: app/configurator/components/ui-helpers.ts:399 -#: app/configurator/map/map-chart-options.tsx:240 -#: app/configurator/map/map-chart-options.tsx:433 +#: app/configurator/map/map-chart-options.tsx:232 +#: app/configurator/map/map-chart-options.tsx:425 msgid "controls.color" msgstr "Color" @@ -273,7 +269,7 @@ msgstr "Reset color palette" msgid "controls.color.palette.sequential" msgstr "Sequential" -#: app/configurator/map/map-chart-options.tsx:437 +#: app/configurator/map/map-chart-options.tsx:429 msgid "controls.color.select" msgstr "Select a color" @@ -293,8 +289,8 @@ msgstr "Stacked" msgid "controls.description" msgstr "Description" -#: app/configurator/map/map-chart-options.tsx:182 -#: app/configurator/map/map-chart-options.tsx:394 +#: app/configurator/map/map-chart-options.tsx:174 +#: app/configurator/map/map-chart-options.tsx:386 msgid "controls.dimension.geographical" msgstr "Geographical dimension" @@ -325,11 +321,11 @@ msgstr "Select none" msgid "controls.filters.time.range" msgstr "Time Range" -#: app/configurator/map/map-chart-options.tsx:203 +#: app/configurator/map/map-chart-options.tsx:195 msgid "controls.hierarchy" msgstr "Hierarchy level" -#: app/configurator/map/map-chart-options.tsx:208 +#: app/configurator/map/map-chart-options.tsx:200 msgid "controls.hierarchy.select" msgstr "Select a hierarchy level" @@ -398,8 +394,8 @@ msgid "controls.language.italian" msgstr "Italian" #: app/configurator/components/ui-helpers.ts:391 -#: app/configurator/map/map-chart-options.tsx:222 -#: app/configurator/map/map-chart-options.tsx:415 +#: app/configurator/map/map-chart-options.tsx:214 +#: app/configurator/map/map-chart-options.tsx:407 msgid "controls.measure" msgstr "Measure" @@ -411,7 +407,7 @@ msgstr "On" msgid "controls.option.isNotActive" msgstr "Off" -#: app/configurator/map/map-chart-options.tsx:244 +#: app/configurator/map/map-chart-options.tsx:236 msgid "controls.scale.type" msgstr "Scale type" @@ -526,14 +522,14 @@ msgid "controls.select.columnStyle.textStyle" msgstr "Text Style" #: app/configurator/components/chart-options-selector.tsx:179 -#: app/configurator/map/map-chart-options.tsx:190 -#: app/configurator/map/map-chart-options.tsx:402 +#: app/configurator/map/map-chart-options.tsx:182 +#: app/configurator/map/map-chart-options.tsx:394 msgid "controls.select.dimension" msgstr "Select a dimension" #: app/configurator/components/chart-options-selector.tsx:180 -#: app/configurator/map/map-chart-options.tsx:227 -#: app/configurator/map/map-chart-options.tsx:420 +#: app/configurator/map/map-chart-options.tsx:219 +#: app/configurator/map/map-chart-options.tsx:412 msgid "controls.select.measure" msgstr "Select a measure" diff --git a/app/locales/fr/messages.po b/app/locales/fr/messages.po index 5a0b3c0ca..9be67ea47 100644 --- a/app/locales/fr/messages.po +++ b/app/locales/fr/messages.po @@ -116,7 +116,7 @@ msgid "button.share" msgstr "Partager" #: app/configurator/components/ui-helpers.ts:417 -#: app/configurator/map/map-chart-options.tsx:167 +#: app/configurator/map/map-chart-options.tsx:159 msgid "chart.map.layers.area" msgstr "Zones" @@ -124,11 +124,11 @@ msgstr "Zones" msgid "chart.map.layers.area.discretization.continuous" msgstr "Continue" -#: app/configurator/map/map-chart-options.tsx:264 +#: app/configurator/map/map-chart-options.tsx:256 msgid "chart.map.layers.area.discretization.discrete" msgstr "Discrète" -#: app/configurator/map/map-chart-options.tsx:312 +#: app/configurator/map/map-chart-options.tsx:304 msgid "chart.map.layers.area.discretization.jenks" msgstr "Jenks (intervalles naturels)" @@ -136,7 +136,7 @@ msgstr "Jenks (intervalles naturels)" msgid "chart.map.layers.area.discretization.quantiles" msgstr "Quantiles (distribution homogène des valeurs)" -#: app/configurator/map/map-chart-options.tsx:298 +#: app/configurator/map/map-chart-options.tsx:290 msgid "chart.map.layers.area.discretization.quantize" msgstr "Intervalles égaux" @@ -147,12 +147,8 @@ msgid "chart.map.layers.base" msgstr "Couche de base" #: app/configurator/map/map-chart-options.tsx:64 -msgid "chart.map.layers.base.show.relief" -msgstr "Afficher le relief" - -#: app/configurator/map/map-chart-options.tsx:72 -msgid "chart.map.layers.base.show.water" -msgstr "Montrer les lacs et les rivières" +msgid "chart.map.layers.base.show" +msgstr "Afficher" #: app/configurator/map/map-chart-options.tsx:171 #: app/configurator/map/map-chart-options.tsx:383 @@ -160,7 +156,7 @@ msgid "chart.map.layers.show" msgstr "Afficher la couche" #: app/configurator/components/ui-helpers.ts:421 -#: app/configurator/map/map-chart-options.tsx:379 +#: app/configurator/map/map-chart-options.tsx:371 msgid "chart.map.layers.symbol" msgstr "Symboles" @@ -246,8 +242,8 @@ msgid "controls.chart.type.table" msgstr "Tableau" #: app/configurator/components/ui-helpers.ts:399 -#: app/configurator/map/map-chart-options.tsx:240 -#: app/configurator/map/map-chart-options.tsx:433 +#: app/configurator/map/map-chart-options.tsx:232 +#: app/configurator/map/map-chart-options.tsx:425 msgid "controls.color" msgstr "Couleur" @@ -269,7 +265,7 @@ msgstr "Réinitialiser la palette de couleurs" msgid "controls.color.palette.sequential" msgstr "Séquentielle" -#: app/configurator/map/map-chart-options.tsx:437 +#: app/configurator/map/map-chart-options.tsx:429 msgid "controls.color.select" msgstr "Sélectionner une couleur" @@ -289,8 +285,8 @@ msgstr "empilées" msgid "controls.description" msgstr "Description" -#: app/configurator/map/map-chart-options.tsx:182 -#: app/configurator/map/map-chart-options.tsx:394 +#: app/configurator/map/map-chart-options.tsx:174 +#: app/configurator/map/map-chart-options.tsx:386 msgid "controls.dimension.geographical" msgstr "Dimension géographique" @@ -321,11 +317,11 @@ msgstr "Tout déselectionner" msgid "controls.filters.time.range" msgstr "Intervalle de temps" -#: app/configurator/map/map-chart-options.tsx:203 +#: app/configurator/map/map-chart-options.tsx:195 msgid "controls.hierarchy" msgstr "Niveau hiérarchique" -#: app/configurator/map/map-chart-options.tsx:208 +#: app/configurator/map/map-chart-options.tsx:200 msgid "controls.hierarchy.select" msgstr "Sélectionner le niveau hiérarchique" @@ -394,8 +390,8 @@ msgid "controls.language.italian" msgstr "Italien" #: app/configurator/components/ui-helpers.ts:391 -#: app/configurator/map/map-chart-options.tsx:222 -#: app/configurator/map/map-chart-options.tsx:415 +#: app/configurator/map/map-chart-options.tsx:214 +#: app/configurator/map/map-chart-options.tsx:407 msgid "controls.measure" msgstr "Variable mesurée" @@ -407,7 +403,7 @@ msgstr "Actif" msgid "controls.option.isNotActive" msgstr "Inactif" -#: app/configurator/map/map-chart-options.tsx:244 +#: app/configurator/map/map-chart-options.tsx:236 msgid "controls.scale.type" msgstr "Type d'échelle" @@ -522,14 +518,14 @@ msgid "controls.select.columnStyle.textStyle" msgstr "Style du texte" #: app/configurator/components/chart-options-selector.tsx:179 -#: app/configurator/map/map-chart-options.tsx:190 -#: app/configurator/map/map-chart-options.tsx:402 +#: app/configurator/map/map-chart-options.tsx:182 +#: app/configurator/map/map-chart-options.tsx:394 msgid "controls.select.dimension" msgstr "Sélectionner une dimension" #: app/configurator/components/chart-options-selector.tsx:180 -#: app/configurator/map/map-chart-options.tsx:227 -#: app/configurator/map/map-chart-options.tsx:420 +#: app/configurator/map/map-chart-options.tsx:219 +#: app/configurator/map/map-chart-options.tsx:412 msgid "controls.select.measure" msgstr "Sélectionner une variable" diff --git a/app/locales/it/messages.po b/app/locales/it/messages.po index 4d4f5d533..23e11cd3e 100644 --- a/app/locales/it/messages.po +++ b/app/locales/it/messages.po @@ -116,7 +116,7 @@ msgid "button.share" msgstr "Condividi" #: app/configurator/components/ui-helpers.ts:417 -#: app/configurator/map/map-chart-options.tsx:167 +#: app/configurator/map/map-chart-options.tsx:159 msgid "chart.map.layers.area" msgstr "Aree" @@ -124,11 +124,11 @@ msgstr "Aree" msgid "chart.map.layers.area.discretization.continuous" msgstr "Continuo" -#: app/configurator/map/map-chart-options.tsx:264 +#: app/configurator/map/map-chart-options.tsx:256 msgid "chart.map.layers.area.discretization.discrete" msgstr "Discreto" -#: app/configurator/map/map-chart-options.tsx:312 +#: app/configurator/map/map-chart-options.tsx:304 msgid "chart.map.layers.area.discretization.jenks" msgstr "Jenks (interruzioni naturali)" @@ -136,7 +136,7 @@ msgstr "Jenks (interruzioni naturali)" msgid "chart.map.layers.area.discretization.quantiles" msgstr "Quantili (distribuzione omogenea dei valori)" -#: app/configurator/map/map-chart-options.tsx:298 +#: app/configurator/map/map-chart-options.tsx:290 msgid "chart.map.layers.area.discretization.quantize" msgstr "Intervalli uguali" @@ -147,12 +147,8 @@ msgid "chart.map.layers.base" msgstr "Livello di base" #: app/configurator/map/map-chart-options.tsx:64 -msgid "chart.map.layers.base.show.relief" -msgstr "Mostra il rilievo" - -#: app/configurator/map/map-chart-options.tsx:72 -msgid "chart.map.layers.base.show.water" -msgstr "Mostra laghi e fiumi" +msgid "chart.map.layers.base.show" +msgstr "Mostra" #: app/configurator/map/map-chart-options.tsx:171 #: app/configurator/map/map-chart-options.tsx:383 @@ -160,7 +156,7 @@ msgid "chart.map.layers.show" msgstr "Mostra il livello" #: app/configurator/components/ui-helpers.ts:421 -#: app/configurator/map/map-chart-options.tsx:379 +#: app/configurator/map/map-chart-options.tsx:371 msgid "chart.map.layers.symbol" msgstr "Simboli" @@ -246,8 +242,8 @@ msgid "controls.chart.type.table" msgstr "Tabella" #: app/configurator/components/ui-helpers.ts:399 -#: app/configurator/map/map-chart-options.tsx:240 -#: app/configurator/map/map-chart-options.tsx:433 +#: app/configurator/map/map-chart-options.tsx:232 +#: app/configurator/map/map-chart-options.tsx:425 msgid "controls.color" msgstr "Colore" @@ -269,7 +265,7 @@ msgstr "Ripristina la tavolozza dei colori" msgid "controls.color.palette.sequential" msgstr "Sequenziale" -#: app/configurator/map/map-chart-options.tsx:437 +#: app/configurator/map/map-chart-options.tsx:429 msgid "controls.color.select" msgstr "Seleziona un colore" @@ -289,8 +285,8 @@ msgstr "impilate" msgid "controls.description" msgstr "Descrizione" -#: app/configurator/map/map-chart-options.tsx:182 -#: app/configurator/map/map-chart-options.tsx:394 +#: app/configurator/map/map-chart-options.tsx:174 +#: app/configurator/map/map-chart-options.tsx:386 msgid "controls.dimension.geographical" msgstr "Dimensione geografica" @@ -321,11 +317,11 @@ msgstr "Deseleziona tutto" msgid "controls.filters.time.range" msgstr "intervallo di tempo" -#: app/configurator/map/map-chart-options.tsx:203 +#: app/configurator/map/map-chart-options.tsx:195 msgid "controls.hierarchy" msgstr "Livello gerarchico" -#: app/configurator/map/map-chart-options.tsx:208 +#: app/configurator/map/map-chart-options.tsx:200 msgid "controls.hierarchy.select" msgstr "Selezionare un livello gerarchico" @@ -394,8 +390,8 @@ msgid "controls.language.italian" msgstr "Italiano" #: app/configurator/components/ui-helpers.ts:391 -#: app/configurator/map/map-chart-options.tsx:222 -#: app/configurator/map/map-chart-options.tsx:415 +#: app/configurator/map/map-chart-options.tsx:214 +#: app/configurator/map/map-chart-options.tsx:407 msgid "controls.measure" msgstr "Misura" @@ -407,7 +403,7 @@ msgstr "Attivo" msgid "controls.option.isNotActive" msgstr "Inattivo" -#: app/configurator/map/map-chart-options.tsx:244 +#: app/configurator/map/map-chart-options.tsx:236 msgid "controls.scale.type" msgstr "Tipo di scala" @@ -522,14 +518,14 @@ msgid "controls.select.columnStyle.textStyle" msgstr "Stile del testo" #: app/configurator/components/chart-options-selector.tsx:179 -#: app/configurator/map/map-chart-options.tsx:190 -#: app/configurator/map/map-chart-options.tsx:402 +#: app/configurator/map/map-chart-options.tsx:182 +#: app/configurator/map/map-chart-options.tsx:394 msgid "controls.select.dimension" msgstr "Seleziona una dimensione" #: app/configurator/components/chart-options-selector.tsx:180 -#: app/configurator/map/map-chart-options.tsx:227 -#: app/configurator/map/map-chart-options.tsx:420 +#: app/configurator/map/map-chart-options.tsx:219 +#: app/configurator/map/map-chart-options.tsx:412 msgid "controls.select.measure" msgstr "Seleziona una misura" diff --git a/app/next.config.js b/app/next.config.js index 698322f98..a379d1b41 100644 --- a/app/next.config.js +++ b/app/next.config.js @@ -82,8 +82,12 @@ module.exports = withPreconstruct( } } } - - config.resolve.extensions.push(dev ? '.dev.ts' : '.prod.ts') + + config.resolve.extensions.push(dev ? ".dev.ts" : ".prod.ts"); + config.resolve.alias = { + ...config.resolve.alias, + "mapbox-gl": "maplibre-gl", + }; // For some reason these need to be ignored for serverless target config.plugins.push(new IgnorePlugin(/^(pg-native|vue)$/)); diff --git a/app/package.json b/app/package.json index 1295c0d2b..f66f11ba4 100644 --- a/app/package.json +++ b/app/package.json @@ -14,6 +14,7 @@ }, "dependencies": { "@babel/standalone": "^7.11.6", + "@deck.gl/carto": "^8.6.8", "@deck.gl/core": "8.6.7", "@deck.gl/extensions": "8.6.7", "@deck.gl/geo-layers": "8.6.7", @@ -58,6 +59,7 @@ "io-ts": "^2.2.10", "isomorphic-unfetch": "^3.0.0", "lodash": "^4.17.20", + "maplibre-gl": "^2.1.1", "micro-cors": "^0.1.1", "nanoid": "^3.1.12", "nprogress": "^0.2.0", @@ -71,6 +73,7 @@ "react-day-picker": "^7.4.10", "react-error-boundary": "^3.1.3", "react-inspector": "^5.1.1", + "react-map-gl": "^6.1.19", "react-table": "^7.5.1", "react-virtual": "^2.3.1", "react-window": "^1.8.6", diff --git a/app/typings/deckgl.d.ts b/app/typings/deckgl.d.ts index 9af35e555..a64729d53 100644 --- a/app/typings/deckgl.d.ts +++ b/app/typings/deckgl.d.ts @@ -43,3 +43,7 @@ declare module "@deck.gl/react" { export const DeckGL: $FixMe; export default DeckGL; } + +declare module "@deck.gl/carto" { + export const BASEMAP: $FixMe; +} diff --git a/yarn.lock b/yarn.lock index 527bf5608..912020d19 100644 --- a/yarn.lock +++ b/yarn.lock @@ -112,16 +112,16 @@ integrity sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q== "@babel/core@7.12.9", "@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.12.9", "@babel/core@^7.14.6", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.7.7": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.0.tgz#16b8772b0a567f215839f689c5ded6bb20e864d5" - integrity sha512-x/5Ea+RO5MvF9ize5DeVICJoVrNv0Mi2RnIABrZEKYvPEpldXwauPkgvYA17cKa6WpU3LoYvYbuEMFtSNFsarA== + version "7.17.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.2.tgz#2c77fc430e95139d816d39b113b31bf40fb22337" + integrity sha512-R3VH5G42VSDolRHyUO4V2cfag8WHcZyxdq5Z/m8Xyb92lW/Erm/6kM+XtRFGf3Mulre3mveni2NHfEUws8wSvw== dependencies: "@ampproject/remapping" "^2.0.0" "@babel/code-frame" "^7.16.7" "@babel/generator" "^7.17.0" "@babel/helper-compilation-targets" "^7.16.7" "@babel/helper-module-transforms" "^7.16.7" - "@babel/helpers" "^7.17.0" + "@babel/helpers" "^7.17.2" "@babel/parser" "^7.17.0" "@babel/template" "^7.16.7" "@babel/traverse" "^7.17.0" @@ -382,15 +382,6 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== -"@babel/helpers@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.7.tgz#7e3504d708d50344112767c3542fc5e357fffefc" - integrity sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw== - dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" - "@babel/helpers@^7.17.0": version "7.17.0" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.0.tgz#79cdf6c66a579f3a7b5e739371bc63ca0306886b" @@ -400,6 +391,15 @@ "@babel/traverse" "^7.17.0" "@babel/types" "^7.17.0" +"@babel/helpers@^7.17.2": + version "7.17.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.2.tgz#23f0a0746c8e287773ccd27c14be428891f63417" + integrity sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ== + dependencies: + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.0" + "@babel/types" "^7.17.0" + "@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" @@ -418,7 +418,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.12.16", "@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.11.5", "@babel/parser@^7.12.13", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.16.10", "@babel/parser@^7.16.12", "@babel/parser@^7.16.7", "@babel/parser@^7.17.0", "@babel/parser@^7.7.2": +"@babel/parser@7.12.16", "@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.11.5", "@babel/parser@^7.12.13", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.16.10", "@babel/parser@^7.16.7", "@babel/parser@^7.17.0", "@babel/parser@^7.7.2": version "7.17.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.0.tgz#f0ac33eddbe214e4105363bb17c3341c5ffcc43c" integrity sha512-VKXSCQx5D8S04ej+Dqsr1CzYvvWgf20jIw2D+YhQCrIlr2UZGaDds23Y0xg75/skOxpLCRpUZvk/1EAVkGoDOw== @@ -788,7 +788,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.16.10", "@babel/traverse@^7.16.7": +"@babel/traverse@^7.16.7": version "7.16.10" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.10.tgz#448f940defbe95b5a8029975b051f75993e8239f" integrity sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw== @@ -940,6 +940,18 @@ debug "^3.1.0" lodash.once "^4.1.1" +"@deck.gl/carto@^8.6.8": + version "8.6.8" + resolved "https://registry.yarnpkg.com/@deck.gl/carto/-/carto-8.6.8.tgz#92312a6cdfe3d34fa0926b1a3fe773c137a1ad9b" + integrity sha512-+uzKekLYuqpYqhSOAnIssg5rKVdGeU+r+TMNKP3B3ENgeO5tGC6+I/fiFTNA7Lw/YaKE/XZStUwW5TK+8G+70Q== + dependencies: + "@loaders.gl/loader-utils" "^3.1.5" + "@loaders.gl/mvt" "^3.1.5" + "@loaders.gl/tiles" "^3.1.5" + "@math.gl/web-mercator" "^3.5.6" + cartocolor "^4.0.2" + d3-scale "^3.2.3" + "@deck.gl/core@8.6.7": version "8.6.7" resolved "https://registry.yarnpkg.com/@deck.gl/core/-/core-8.6.7.tgz#9e53ac5cd0b152b6346d837927048e1ccf0f819f" @@ -2473,12 +2485,35 @@ "@luma.gl/gltools" "8.5.10" probe.gl "^3.4.0" +"@mapbox/geojson-rewind@^0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@mapbox/geojson-rewind/-/geojson-rewind-0.5.1.tgz#adbe16dc683eb40e90934c51a5e28c7bbf44f4e1" + integrity sha512-eL7fMmfTBKjrb+VFHXCGv9Ot0zc3C0U+CwXo1IrP+EPwDczLoXv34Tgq3y+2mPSFNVUXgU42ILWJTC7145KPTA== + dependencies: + get-stream "^6.0.1" + minimist "^1.2.5" + +"@mapbox/geojson-types@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz#9aecf642cb00eab1080a57c4f949a65b4a5846d6" + integrity sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw== + +"@mapbox/jsonlint-lines-primitives@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz#ce56e539f83552b58d10d672ea4d6fc9adc7b234" + integrity sha1-zlblOfg1UrWNENZy6k1vya3HsjQ= + +"@mapbox/mapbox-gl-supported@^2.0.0", "@mapbox/mapbox-gl-supported@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-2.0.1.tgz#c15367178d8bfe4765e6b47b542fe821ce259c7b" + integrity sha512-HP6XvfNIzfoMVfyGjBckjiAOQK9WfX0ywdLubuPMPv+Vqf5fj0uCbgBQYpiqcWZT6cbyyRnTSXDheT1ugvF6UQ== + "@mapbox/martini@^0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@mapbox/martini/-/martini-0.2.0.tgz#1af70211fbe994abf26e37f1388ca69c02cd43b4" integrity sha512-7hFhtkb0KTLEls+TRw/rWayq5EeHtTaErgm/NskVoXmtgAQu/9D299aeyj6mzAR/6XUnYRp2lU+4IcrYRFjVsQ== -"@mapbox/point-geometry@~0.1.0": +"@mapbox/point-geometry@0.1.0", "@mapbox/point-geometry@^0.1.0", "@mapbox/point-geometry@~0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz#8a83f9335c7860effa2eeeca254332aa0aeed8f2" integrity sha1-ioP5M1x4YO/6Lu7KJUMyqgru2PI= @@ -2488,6 +2523,21 @@ resolved "https://registry.yarnpkg.com/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz#424c620a96442b20402552be70a7f62a8407cc59" integrity sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw== +"@mapbox/tiny-sdf@^2.0.2", "@mapbox/tiny-sdf@^2.0.4": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@mapbox/tiny-sdf/-/tiny-sdf-2.0.5.tgz#cdba698d3d65087643130f9af43a2b622ce0b372" + integrity sha512-OhXt2lS//WpLdkqrzo/KwB7SRD8AiNTFFzuo9n14IBupzIMa67yGItcK7I2W9D8Ghpa4T04Sw9FWsKCJG50Bxw== + +"@mapbox/unitbezier@^0.0.0": + version "0.0.0" + resolved "https://registry.yarnpkg.com/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz#15651bd553a67b8581fb398810c98ad86a34524e" + integrity sha1-FWUb1VOme4WB+zmIEMmK2Go0Uk4= + +"@mapbox/unitbezier@^0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz#d32deb66c7177e9e9dfc3bbd697083e2e657ff01" + integrity sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw== + "@mapbox/vector-tile@^1.3.1": version "1.3.1" resolved "https://registry.yarnpkg.com/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz#d3a74c90402d06e89ec66de49ec817ff53409666" @@ -2495,6 +2545,11 @@ dependencies: "@mapbox/point-geometry" "~0.1.0" +"@mapbox/whoots-js@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz#497c67a1cef50d1a2459ba60f315e448d2ad87fe" + integrity sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q== + "@math.gl/core@3.5.7", "@math.gl/core@^3.5.0", "@math.gl/core@^3.5.1": version "3.5.7" resolved "https://registry.yarnpkg.com/@math.gl/core/-/core-3.5.7.tgz#41145f214c36f20a6bf32e4c25551e97c6828e99" @@ -2528,7 +2583,7 @@ dependencies: "@math.gl/core" "3.5.7" -"@math.gl/web-mercator@^3.5.1", "@math.gl/web-mercator@^3.5.6": +"@math.gl/web-mercator@^3.5.1", "@math.gl/web-mercator@^3.5.5", "@math.gl/web-mercator@^3.5.6": version "3.5.7" resolved "https://registry.yarnpkg.com/@math.gl/web-mercator/-/web-mercator-3.5.7.tgz#180a1057ea622bd857c6931f67268c2e98f174c6" integrity sha512-i0w6AcV2b5+yeUQOA/KdnnzTYMUZvEKzHbbxI+ZyCuFs3p9S/IUt/EWVw4KGGOjVbf3UrGFlWSM70Th+0KyrsA== @@ -4011,6 +4066,13 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== +"@types/mapbox-gl@^2.0.3": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@types/mapbox-gl/-/mapbox-gl-2.6.0.tgz#f9e8e963d5a11eba9d914d95ef8a00d015ca8732" + integrity sha512-lHdITzC0IVn9+Pq6WFkkK0N6rUKIqxsdrNeixiQdvROFn2Aeu3TDvhpuag1IdengL5WGGRuEhK6m6HB916ReLw== + dependencies: + "@types/geojson" "*" + "@types/mdast@^3.0.0": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.3.tgz#2d7d671b1cd1ea3deb306ea75036c2a0407d2deb" @@ -5584,6 +5646,13 @@ capital-case@^1.0.4: tslib "^2.0.3" upper-case-first "^2.0.2" +cartocolor@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cartocolor/-/cartocolor-4.0.2.tgz#ef1aa12860f6eeedc8d2420e2b9d7337937c4993" + integrity sha512-+Gh9mb6lFxsDOLQlBLPxAHCnWXlg2W8q3AcVwqRcy95TdBbcOU89Wrb6h2Hd/6Ww1Kc1pzXmUdpnWD+xeCG0dg== + dependencies: + colorbrewer "1.0.0" + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -5934,6 +6003,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +colorbrewer@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/colorbrewer/-/colorbrewer-1.0.0.tgz#4f97333b969ba7612382be4bc3394b341fb4c8a2" + integrity sha1-T5czO5abp2Ejgr5LwzlLNB+0yKI= + colorette@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" @@ -6289,6 +6363,11 @@ css.escape@1.5.1: resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" integrity sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s= +csscolorparser@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/csscolorparser/-/csscolorparser-1.0.3.tgz#b34f391eea4da8f3e98231e2ccd8df9c041f171b" + integrity sha1-s085HupNqPPpgjHizNjfnAQfFxs= + cssfilter@0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/cssfilter/-/cssfilter-0.0.10.tgz#c6d2672632a2e5c83e013e6864a42ce8defd20ae" @@ -6557,7 +6636,7 @@ d3-scale-chromatic@2: d3-color "1 - 2" d3-interpolate "1 - 2" -d3-scale@3: +d3-scale@3, d3-scale@^3.2.3: version "3.3.0" resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-3.3.0.tgz#28c600b29f47e5b9cd2df9749c206727966203f3" integrity sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ== @@ -7056,6 +7135,11 @@ earcut@^2.0.6: resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.2.2.tgz#41b0bc35f63e0fe80da7cddff28511e7e2e80d11" integrity sha512-eZoZPPJcUHnfRZ0PjLvx2qBordSiO8ofC3vt+qACLM95u+4DovnbYNpQtJh0DNsWj8RnxrQytD4WA8gj5cRIaQ== +earcut@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.2.3.tgz#d44ced2ff5a18859568e327dd9c7d46b16f55cf4" + integrity sha512-iRDI1QeCQIhMCZk48DRDMVgQSSBDmbzzNhnxIo+pwx3swkfjMh6vh0nWLq1NdvGHLKH6wIrAM3vQWeTj6qeoug== + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -7994,6 +8078,11 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== +geojson-vt@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/geojson-vt/-/geojson-vt-3.2.1.tgz#f8adb614d2c1d3f6ee7c4265cad4bbf3ad60c8b7" + integrity sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg== + get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -8034,7 +8123,7 @@ get-stream@^5.0.0, get-stream@^5.1.0: dependencies: pump "^3.0.0" -get-stream@^6.0.0: +get-stream@^6.0.0, get-stream@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== @@ -8065,6 +8154,11 @@ gl-matrix@^3.0.0, gl-matrix@~3.3.0: resolved "https://registry.yarnpkg.com/gl-matrix/-/gl-matrix-3.3.0.tgz#232eef60b1c8b30a28cbbe75b2caf6c48fd6358b" integrity sha512-COb7LDz+SXaHtl/h4LeaFcNdJdAQSDeVqjiIihSXNrkWObZLhDI4hIkZC11Aeqp7bcE72clzB0BnDXr2SmslRA== +gl-matrix@^3.3.0, gl-matrix@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/gl-matrix/-/gl-matrix-3.4.3.tgz#fc1191e8320009fd4d20e9339595c6041ddc22c9" + integrity sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA== + glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -8322,6 +8416,11 @@ graphql@^15.5.1: resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.1.tgz#f2f84415d8985e7b84731e7f3536f8bb9d383aad" integrity sha512-FeTRX67T3LoE3LWAxxOlW2K3Bz+rMYAC18rRguK4wgXaTZMiJwSUwDmPFo3UadAKbzirKIg5Qy+sNJXbpPRnQw== +grid-index@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/grid-index/-/grid-index-1.1.0.tgz#97f8221edec1026c8377b86446a7c71e79522ea7" + integrity sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA== + gzip-size@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" @@ -10028,6 +10127,11 @@ jws@^3.2.2: jwa "^1.4.1" safe-buffer "^5.0.1" +kdbush@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-3.0.0.tgz#f8484794d47004cc2d85ed3a79353dbe0abc2bf0" + integrity sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew== + keyv@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" @@ -10537,6 +10641,60 @@ map-stream@~0.1.0: resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= +mapbox-gl@^2.3.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mapbox-gl/-/mapbox-gl-2.7.0.tgz#ff8f6e6f948ed468ae75c9d71884aa59af67505a" + integrity sha512-7sNoQIpizMjoQkFIcxpWzFCcMd8GJFN0Po00oFZGm1X7xS5XMrzwu+ClfO/ehZqKLa9IS7E3Pj0e2PT+9KeqaA== + dependencies: + "@mapbox/geojson-rewind" "^0.5.1" + "@mapbox/geojson-types" "^1.0.2" + "@mapbox/jsonlint-lines-primitives" "^2.0.2" + "@mapbox/mapbox-gl-supported" "^2.0.0" + "@mapbox/point-geometry" "^0.1.0" + "@mapbox/tiny-sdf" "^2.0.2" + "@mapbox/unitbezier" "^0.0.0" + "@mapbox/vector-tile" "^1.3.1" + "@mapbox/whoots-js" "^3.1.0" + csscolorparser "~1.0.3" + earcut "^2.2.3" + geojson-vt "^3.2.1" + gl-matrix "^3.3.0" + grid-index "^1.1.0" + minimist "^1.2.5" + murmurhash-js "^1.0.0" + pbf "^3.2.1" + potpack "^1.0.1" + quickselect "^2.0.0" + rw "^1.3.3" + supercluster "^7.1.4" + tinyqueue "^2.0.3" + vt-pbf "^3.1.3" + +maplibre-gl@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/maplibre-gl/-/maplibre-gl-2.1.1.tgz#561f5ad94a2e7e1f3e1be75ed994a5bf0b54c9c9" + integrity sha512-FRAHc4kPYKDF0+QMm8tnkyhv65Ed5SKLbzcH6hHM20XAK+9pqHMIHxlwpxcb4zGl+czz1bUegYf/KXjJRh9aDA== + dependencies: + "@mapbox/geojson-rewind" "^0.5.1" + "@mapbox/jsonlint-lines-primitives" "^2.0.2" + "@mapbox/mapbox-gl-supported" "^2.0.1" + "@mapbox/point-geometry" "^0.1.0" + "@mapbox/tiny-sdf" "^2.0.4" + "@mapbox/unitbezier" "^0.0.1" + "@mapbox/vector-tile" "^1.3.1" + "@mapbox/whoots-js" "^3.1.0" + csscolorparser "~1.0.3" + earcut "^2.2.3" + geojson-vt "^3.2.1" + gl-matrix "^3.4.3" + murmurhash-js "^1.0.0" + pbf "^3.2.1" + potpack "^1.0.2" + quickselect "^2.0.0" + supercluster "^7.1.4" + tinyqueue "^2.0.3" + vt-pbf "^3.1.3" + markdown-escapes@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" @@ -10819,6 +10977,11 @@ ms@^2.1.1, ms@^2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +murmurhash-js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/murmurhash-js/-/murmurhash-js-1.0.0.tgz#b06278e21fc6c37fa5313732b0412bcb6ae15f51" + integrity sha1-sGJ44h/Gw3+lMTcysEEry2rhX1E= + mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -11815,6 +11978,11 @@ postgres-migrations@^5.2.0: pg "^8.6.0" sql-template-strings "^2.2.2" +potpack@^1.0.1, potpack@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/potpack/-/potpack-1.0.2.tgz#23b99e64eb74f5741ffe7656b5b5c4ddce8dfc14" + integrity sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -12081,6 +12249,11 @@ quick-lru@^5.1.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== +quickselect@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/quickselect/-/quickselect-2.0.0.tgz#f19680a486a5eefb581303e023e98faaf25dd018" + integrity sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw== + raf-schd@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/raf-schd/-/raf-schd-4.0.3.tgz#5d6c34ef46f8b2a0e880a8fcdb743efc5bfdbc1a" @@ -12265,6 +12438,20 @@ react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-map-gl@^6.1.19: + version "6.1.19" + resolved "https://registry.yarnpkg.com/react-map-gl/-/react-map-gl-6.1.19.tgz#7c5e2d6c0ba582376157af942fa004fe6f3c28b8" + integrity sha512-rrDoRyEIGzVLUB5QfgsZ5xCw7jeUtmmYzHUv86xDx8oGp90VTV2KTQJ4RPQiSAmpfIFh6/pPqI28Pguf1u/mOg== + dependencies: + "@babel/runtime" "^7.0.0" + "@types/geojson" "^7946.0.7" + "@types/mapbox-gl" "^2.0.3" + mapbox-gl "^2.3.0" + mjolnir.js "^2.5.0" + prop-types "^15.7.2" + resize-observer-polyfill "^1.5.1" + viewport-mercator-project "^7.0.4" + react-redux@^7.2.0: version "7.2.4" resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.4.tgz#1ebb474032b72d806de2e0519cd07761e222e225" @@ -12630,6 +12817,11 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +resize-observer-polyfill@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" + integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -12820,7 +13012,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rw@1: +rw@1, rw@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4" integrity sha1-P4Yt+pGrdmsUiF700BEkv9oHT7Q= @@ -13615,6 +13807,13 @@ subscriptions-transport-ws@^0.9.18, subscriptions-transport-ws@^0.9.19: symbol-observable "^1.0.4" ws "^5.2.0 || ^6.0.0 || ^7.0.0" +supercluster@^7.1.4: + version "7.1.4" + resolved "https://registry.yarnpkg.com/supercluster/-/supercluster-7.1.4.tgz#6762aabfd985d3390b49f13b815567d5116a828a" + integrity sha512-GhKkRM1jMR6WUwGPw05fs66pOFWhf59lXq+Q3J3SxPvhNcmgOtLRV6aVQPMRsmXdpaeFJGivt+t7QXUPL3ff4g== + dependencies: + kdbush "^3.0.0" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -13833,6 +14032,11 @@ tinycolor2@^1.4.1: resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.2.tgz#3f6a4d1071ad07676d7fa472e1fac40a719d8803" integrity sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA== +tinyqueue@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/tinyqueue/-/tinyqueue-2.0.3.tgz#64d8492ebf39e7801d7bd34062e29b45b2035f08" + integrity sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA== + title-case@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/title-case/-/title-case-3.0.3.tgz#bc689b46f02e411f1d1e1d081f7c3deca0489982" @@ -14519,11 +14723,27 @@ vfile@^4.0.0: unist-util-stringify-position "^2.0.0" vfile-message "^2.0.0" +viewport-mercator-project@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/viewport-mercator-project/-/viewport-mercator-project-7.0.4.tgz#67feec04135484bf424dd4890d630e82116b31e6" + integrity sha512-0jzpL6pIMocCKWg1C3mqi/N4UPgZC3FzwghEm1H+XsUo8hNZAyJc3QR7YqC816ibOR8aWT5pCsV+gCu8/BMJgg== + dependencies: + "@math.gl/web-mercator" "^3.5.5" + vm-browserify@1.1.2, vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== +vt-pbf@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/vt-pbf/-/vt-pbf-3.1.3.tgz#68fd150756465e2edae1cc5c048e063916dcfaac" + integrity sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA== + dependencies: + "@mapbox/point-geometry" "0.1.0" + "@mapbox/vector-tile" "^1.3.1" + pbf "^3.2.1" + w3c-hr-time@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"