diff --git a/website/src/lib/assets/custom/bikerouter-gravel.json b/website/src/lib/assets/custom/bikerouter-gravel.json new file mode 100644 index 00000000..d466cc67 --- /dev/null +++ b/website/src/lib/assets/custom/bikerouter-gravel.json @@ -0,0 +1,1864 @@ +{ + "_info": "Taken from https://github.com/mjaschen/gravel-overlay, with prior authorization from the author (https://github.com/gpxstudio/gpx.studio/issues/32#issuecomment-2320219804).", + "version": 8, + "name": "Gravel Overlay", + "metadata": { + "mapbox:autocomposite": false, + "mapbox:type": "template", + "maputnik:renderer": "mbgljs", + "openmaptiles:version": "3.x", + "openmaptiles:mapbox:owner": "openmaptiles", + "openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t" + }, + "sources": { + "openmaptiles": { + "type": "vector", + "url": "https://tiles.bikerouter.de/services/gravel/" + } + }, + "sprite": "https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite", + "glyphs": "https://api.maptiler.com/fonts/{fontstack}/{range}.pbf?key={key}", + "layers": [ + { + "id": "background", + "type": "background", + "layout": { + "visibility": "none" + }, + "paint": { + "background-color": "rgba(145, 211, 164, 1)" + } + }, + { + "id": "debug_rail", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "rail" + ] + ], + "layout": { + "visibility": "none" + }, + "paint": { + "line-color": "rgba(144, 144, 144, 1)" + } + }, + { + "id": "debug_road", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "motorway", + "trunk", + "primary", + "secondary", + "tertiary", + "minor", + "residential", + "track", + "path" + ] + ], + "layout": { + "visibility": "none" + }, + "paint": { + "line-color": "rgba(204, 204, 204, 1)", + "line-width": { + "stops": [ + [ + 10, + 0.5 + ], + [ + 12, + 1 + ] + ] + } + } + }, + { + "id": "tr_X_g45-bg", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + [ + "match", + [ + "get", + "class" + ], + [ + "track" + ], + true, + false + ], + [ + "any", + [ + "match", + [ + "get", + "tracktype" + ], + [ + "grade5" + ], + true, + false + ], + [ + "all", + [ + "match", + [ + "get", + "tracktype" + ], + [ + "grade4" + ], + true, + false + ], + [ + "match", + [ + "get", + "surface" + ], + [ + "dirt", + "grass", + "mud", + "sand" + ], + true, + false + ] + ] + ] + ], + "layout": { + "line-cap": "square", + "line-join": "bevel", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 0, 0, 0.7)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.4 + ], + [ + 12, + 1.3 + ], + [ + 14, + 1.7 + ] + ] + }, + "line-dasharray": [ + 1 + ], + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 1.8 + ], + [ + 15, + 3 + ], + [ + 16, + 4 + ] + ], + "base": 1.55 + } + } + }, + { + "id": "tr_X_g45", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + [ + "match", + [ + "get", + "class" + ], + [ + "track" + ], + true, + false + ], + [ + "any", + [ + "match", + [ + "get", + "tracktype" + ], + [ + "grade5" + ], + true, + false + ], + [ + "all", + [ + "match", + [ + "get", + "tracktype" + ], + [ + "grade4" + ], + true, + false + ], + [ + "match", + [ + "get", + "surface" + ], + [ + "dirt", + "grass", + "mud", + "sand" + ], + true, + false + ] + ] + ] + ], + "layout": { + "line-cap": "square", + "line-join": "bevel", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 0, 0.7)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.4 + ], + [ + 12, + 1.3 + ], + [ + 14, + 1.7 + ] + ] + }, + "line-dasharray": [ + 2, + 2 + ], + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 1.8 + ], + [ + 15, + 3 + ], + [ + 16, + 4 + ] + ], + "base": 1.55 + } + } + }, + { + "id": "tr_B_g3", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + [ + "==", + [ + "get", + "class" + ], + "track" + ], + [ + "match", + [ + "get", + "tracktype" + ], + [ + "grade3" + ], + true, + false + ], + [ + "any", + [ + "match", + [ + "get", + "smoothness" + ], + [ + "bad", + "good", + "intermediate" + ], + true, + false + ], + [ + "match", + [ + "get", + "surface" + ], + [ + "compacted", + "fine_gravel", + "gravel" + ], + true, + false + ] + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(235, 6, 158, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.4 + ], + [ + 12, + 1.3 + ], + [ + 14, + 1.7 + ] + ] + }, + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 2 + ], + [ + 15, + 4 + ], + [ + 16, + 5 + ] + ], + "base": 1.55 + }, + "line-dasharray": [ + 3, + 1.5 + ] + } + }, + { + "id": "tr_A_g2-plain-case", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + [ + "==", + [ + "get", + "class" + ], + "track" + ], + [ + "match", + [ + "get", + "tracktype" + ], + [ + "grade2" + ], + true, + false + ], + [ + "!", + [ + "has", + "surface" + ] + ], + [ + "!", + [ + "has", + "smoothness" + ] + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 255, 0.6)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.8 + ], + [ + 12, + 3 + ], + [ + 14, + 4 + ] + ] + }, + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 1.5 + ], + [ + 15, + 3 + ], + [ + 16, + 4 + ] + ], + "base": 1.55 + } + } + }, + { + "id": "tr_A_g2-plain", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + [ + "==", + [ + "get", + "class" + ], + "track" + ], + [ + "match", + [ + "get", + "tracktype" + ], + [ + "grade2" + ], + true, + false + ], + [ + "!", + [ + "has", + "surface" + ] + ], + [ + "!", + [ + "has", + "smoothness" + ] + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(235, 6, 158, 0.6)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.5 + ], + [ + 12, + 1.5 + ], + [ + 14, + 2 + ] + ] + }, + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 1.5 + ], + [ + 15, + 3 + ], + [ + 16, + 4 + ] + ], + "base": 1.55 + }, + "line-dasharray": [ + 5, + 1 + ] + } + }, + { + "id": "tr_A_g2-case", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + [ + "==", + [ + "get", + "class" + ], + "track" + ], + [ + "match", + [ + "get", + "tracktype" + ], + [ + "grade2" + ], + true, + false + ], + [ + "any", + [ + "match", + [ + "get", + "surface" + ], + [ + "compacted", + "fine_gravel", + "gravel" + ], + true, + false + ], + [ + "match", + [ + "get", + "smoothness" + ], + [ + "bad", + "good", + "intermediate" + ], + true, + false + ] + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 255, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.8 + ], + [ + 12, + 3 + ], + [ + 14, + 4 + ] + ] + }, + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 2 + ], + [ + 15, + 4 + ], + [ + 16, + 5 + ] + ], + "base": 1.55 + } + } + }, + { + "id": "tr_A_g2", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + [ + "==", + [ + "get", + "class" + ], + "track" + ], + [ + "match", + [ + "get", + "tracktype" + ], + [ + "grade2" + ], + true, + false + ], + [ + "any", + [ + "match", + [ + "get", + "surface" + ], + [ + "compacted", + "fine_gravel", + "gravel" + ], + true, + false + ], + [ + "match", + [ + "get", + "smoothness" + ], + [ + "bad", + "good", + "intermediate" + ], + true, + false + ] + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(235, 6, 158, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.5 + ], + [ + 12, + 1.5 + ], + [ + 14, + 2 + ] + ] + }, + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 2 + ], + [ + 15, + 4 + ], + [ + 16, + 5 + ] + ], + "base": 1.55 + } + } + }, + { + "id": "p_X-bg", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "path" + ], + [ + "in", + "smoothness", + "very_bad", + "horrible", + "very_horrible", + "impassable" + ], + [ + "!in", + "tracktype", + "grade5", + "grade4" + ] + ], + "layout": { + "line-cap": "square", + "line-join": "bevel", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 0, 0, 0.7)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.4 + ], + [ + 12, + 1.1 + ], + [ + 14, + 1.5 + ] + ] + }, + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 1.8 + ], + [ + 15, + 3 + ], + [ + 16, + 4 + ] + ], + "base": 1.55 + } + } + }, + { + "id": "p_X", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "path" + ], + [ + "in", + "smoothness", + "very_bad", + "horrible", + "very_horrible", + "impassable" + ], + [ + "!in", + "tracktype", + "grade5", + "grade4" + ] + ], + "layout": { + "line-cap": "square", + "line-join": "bevel", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 0, 0.7)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.4 + ], + [ + 12, + 1.1 + ], + [ + 14, + 1.5 + ] + ] + }, + "line-dasharray": [ + 2, + 2 + ], + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 1.8 + ], + [ + 15, + 3 + ], + [ + 16, + 4 + ] + ], + "base": 1.55 + } + } + }, + { + "id": "p_B", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "==", + "class", + "path" + ], + [ + "in", + "smoothness", + "good", + "intermediate", + "bad" + ], + [ + "!in", + "surface", + "gravel", + "fine_gravel", + "compacted", + "cobblestone", + "sett", + "unhewn_cobblestone", + "paving_stones" + ], + [ + "!in", + "bicycle", + "no" + ], + [ + "!in", + "access", + "no" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(235, 6, 158, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.4 + ], + [ + 12, + 1.1 + ], + [ + 14, + 1.5 + ] + ] + }, + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 2 + ], + [ + 15, + 4 + ], + [ + 16, + 5 + ] + ], + "base": 1.55 + }, + "line-dasharray": [ + 1.5, + 1 + ] + } + }, + { + "id": "p_A-case", + "type": "line", + "metadata": { + "maputnik:comment": "Gravel surface with ok-ish smoothness" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + [ + "==", + [ + "get", + "class" + ], + "path" + ], + [ + "any", + [ + "match", + [ + "get", + "surface" + ], + [ + "compacted", + "fine_gravel" + ], + true, + false + ], + [ + "all", + [ + "match", + [ + "get", + "surface" + ], + [ + "gravel" + ], + true, + false + ], + [ + "match", + [ + "get", + "smoothness" + ], + [ + "bad", + "good", + "intermediate" + ], + true, + false + ] + ] + ], + [ + "match", + [ + "get", + "bicycle" + ], + [ + "no" + ], + false, + true + ], + [ + "match", + [ + "get", + "access" + ], + [ + "no" + ], + false, + true + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 255, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.7 + ], + [ + 12, + 2.5 + ], + [ + 14, + 3.2 + ] + ] + }, + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 2 + ], + [ + 15, + 4 + ], + [ + 16, + 5 + ] + ], + "base": 1.55 + } + } + }, + { + "id": "p_A", + "type": "line", + "metadata": { + "maputnik:comment": "Gravel surface with ok-ish smoothness" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + [ + "geometry-type" + ], + "LineString" + ], + [ + "==", + [ + "get", + "class" + ], + "path" + ], + [ + "any", + [ + "match", + [ + "get", + "surface" + ], + [ + "compacted", + "fine_gravel" + ], + true, + false + ], + [ + "all", + [ + "match", + [ + "get", + "surface" + ], + [ + "gravel" + ], + true, + false + ], + [ + "match", + [ + "get", + "smoothness" + ], + [ + "bad", + "good", + "intermediate" + ], + true, + false + ] + ] + ], + [ + "match", + [ + "get", + "bicycle" + ], + [ + "no" + ], + false, + true + ], + [ + "match", + [ + "get", + "access" + ], + [ + "no" + ], + false, + true + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(235, 6, 158, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.5 + ], + [ + 12, + 1.5 + ], + [ + 14, + 2 + ] + ] + }, + "line-offset": { + "stops": [ + [ + 12, + 0 + ], + [ + 13, + 2 + ], + [ + 15, + 4 + ], + [ + 16, + 5 + ] + ], + "base": 1.55 + } + } + }, + { + "id": "r_X_cobbles-case", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "minor", + "service", + "track", + "path", + "residential" + ], + [ + "in", + "surface", + "sett", + "cobblestone", + "unhewn_cobblestone" + ], + [ + "!in", + "service", + "driveway" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(0, 0, 0, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.5 + ], + [ + 12, + 1.5 + ], + [ + 14, + 2 + ] + ] + } + } + }, + { + "id": "r_X_cobbles", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "minor", + "service", + "track", + "path", + "residential" + ], + [ + "in", + "surface", + "sett", + "cobblestone", + "unhewn_cobblestone" + ], + [ + "!in", + "service", + "driveway" + ] + ], + "layout": { + "line-cap": "butt", + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(245, 255, 0, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.5 + ], + [ + 12, + 1.5 + ], + [ + 14, + 2 + ] + ] + }, + "line-dasharray": [ + 1.5, + 1 + ] + } + }, + { + "id": "r_X-bg", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "minor" + ], + [ + "in", + "smoothness", + "very_bad", + "horrible", + "very_horrible", + "impassable" + ], + [ + "!in", + "surface", + "sett", + "cobblestone", + "unhewn_cobblestone" + ] + ], + "layout": { + "line-cap": "square", + "line-join": "bevel", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 0, 0, 0.7)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.4 + ], + [ + 12, + 1.1 + ], + [ + 14, + 1.5 + ] + ] + } + } + }, + { + "id": "r_X", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "minor" + ], + [ + "in", + "smoothness", + "very_bad", + "horrible", + "very_horrible", + "impassable" + ], + [ + "!in", + "surface", + "sett", + "cobblestone", + "unhewn_cobblestone" + ] + ], + "layout": { + "line-cap": "square", + "line-join": "bevel", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 0, 0.7)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.4 + ], + [ + 12, + 1.1 + ], + [ + 14, + 1.5 + ] + ] + }, + "line-dasharray": [ + 2, + 2 + ] + } + }, + { + "id": "r_A_case", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "minor", + "residential", + "service" + ], + [ + "in", + "surface", + "gravel", + "compacted", + "fine_gravel" + ], + [ + "!in", + "service", + "driveway", + "parking_aisle", + "drive-through", + "emergency_access" + ] + ], + "layout": { + "line-cap": "square", + "line-join": "bevel", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(255, 255, 255, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.8 + ], + [ + 12, + 3 + ], + [ + 14, + 4 + ] + ] + } + } + }, + { + "id": "r_A", + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 10, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "minor", + "residential", + "service" + ], + [ + "in", + "surface", + "gravel", + "compacted", + "fine_gravel" + ], + [ + "!in", + "service", + "driveway", + "parking_aisle", + "drive-through", + "emergency_access" + ] + ], + "layout": { + "line-cap": "square", + "line-join": "bevel", + "visibility": "visible" + }, + "paint": { + "line-color": "rgba(235, 6, 158, 1)", + "line-width": { + "base": 1.55, + "stops": [ + [ + 10, + 0.5 + ], + [ + 12, + 1.5 + ], + [ + 14, + 2 + ] + ] + } + } + }, + { + "id": "cemetery", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "all", + [ + "==", + "class", + "cemetery" + ] + ], + "layout": { + "icon-image": "cemetery_11", + "icon-rotation-alignment": "map", + "icon-size": 1.5 + } + }, + { + "id": "drinking_water", + "type": "symbol", + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 9, + "maxzoom": 20, + "filter": [ + "any", + [ + "==", + "class", + "drinking_water" + ], + [ + "==", + "subclass", + "drinking_water" + ] + ], + "layout": { + "icon-image": "drinking_water_11", + "visibility": "visible", + "icon-rotation-alignment": "map", + "icon-size": 1.4 + } + } + ], + "id": "basic", + "owner": "Marcus Jaschen" +} \ No newline at end of file diff --git a/website/src/lib/assets/layers.ts b/website/src/lib/assets/layers.ts index a86a4bad..8fd9aa7c 100644 --- a/website/src/lib/assets/layers.ts +++ b/website/src/lib/assets/layers.ts @@ -1,9 +1,9 @@ -import { PUBLIC_MAPBOX_TOKEN } from '$env/static/public'; import { TramFront, Utensils, ShoppingBasket, Droplet, ShowerHead, Fuel, CircleParking, Fence, FerrisWheel, Bed, Mountain, Pickaxe, Store, TrainFront, Bus, Ship, Croissant, House, Tent, Wrench, Binoculars } from 'lucide-static'; -import { type AnySourceData, type Style } from 'mapbox-gl'; +import { type Style } from 'mapbox-gl'; import ignFrTopo from './custom/ign-fr-topo.json'; import ignFrPlan from './custom/ign-fr-plan.json'; import ignFrSatellite from './custom/ign-fr-satellite.json'; +import bikerouterGravel from './custom/bikerouter-gravel.json'; export const basemaps: { [key: string]: string | Style; } = { mapboxOutdoors: 'mapbox://styles/mapbox/outdoors-v12', @@ -255,144 +255,309 @@ export const basemaps: { [key: string]: string | Style; } = { }, }; -export function extendBasemap(basemap: string | Style): string | Style { - if (typeof basemap === 'object') { - basemap["glyphs"] = "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"; - basemap["sprite"] = `https://api.mapbox.com/styles/v1/mapbox/outdoors-v12/sprite?access_token=${PUBLIC_MAPBOX_TOKEN}`; - } - return basemap; -} - -Object.values(basemaps).forEach(extendBasemap); - -export const font: { [key: string]: string; } = { - swisstopoVector: 'Frutiger Neue Condensed Regular', - swisstopoSatellite: 'Frutiger Neue Condensed Regular', -}; - -export const overlays: { [key: string]: AnySourceData; } = { +export const overlays: { [key: string]: string | Style; } = { cyclOSMlite: { - type: 'raster', - tiles: ['https://a.tile-cyclosm.openstreetmap.fr/cyclosm-lite/{z}/{x}/{y}.png', 'https://b.tile-cyclosm.openstreetmap.fr/cyclosm-lite/{z}/{x}/{y}.png', 'https://c.tile-cyclosm.openstreetmap.fr/cyclosm-lite/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 17, - attribution: '© CyclOSM © OpenStreetMap' + version: 8, + sources: { + cyclOSMlite: { + type: 'raster', + tiles: ['https://a.tile-cyclosm.openstreetmap.fr/cyclosm-lite/{z}/{x}/{y}.png', 'https://b.tile-cyclosm.openstreetmap.fr/cyclosm-lite/{z}/{x}/{y}.png', 'https://c.tile-cyclosm.openstreetmap.fr/cyclosm-lite/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 17, + attribution: '© CyclOSM © OpenStreetMap' + } + }, + layers: [{ + id: 'cyclOSMlite', + type: 'raster', + source: 'cyclOSMlite', + }], }, + bikerouterGravel: bikerouterGravel, swisstopoSlope: { - type: 'raster', - tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.hangneigung-ueber_30/default/current/3857/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 17, - attribution: '© swisstopo', + version: 8, + sources: { + swisstopoSlope: { + type: 'raster', + tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.hangneigung-ueber_30/default/current/3857/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 17, + attribution: '© swisstopo', + }, + }, + layers: [{ + id: 'swisstopoSlope', + type: 'raster', + source: 'swisstopoSlope', + }], }, swisstopoHiking: { - type: 'raster', - tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swisstlm3d-wanderwege/default/current/3857/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 18, - attribution: '© swisstopo' + version: 8, + sources: { + swisstopoHiking: { + type: 'raster', + tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swisstlm3d-wanderwege/default/current/3857/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 18, + attribution: '© swisstopo' + }, + }, + layers: [{ + id: 'swisstopoHiking', + type: 'raster', + source: 'swisstopoHiking', + }], }, swisstopoHikingClosures: { - type: 'raster', - tiles: ['https://wms.geo.admin.ch/?version=1.3.0&service=WMS&request=GetMap&sld_version=1.1.0&layers=ch.astra.wanderland-sperrungen_umleitungen&format=image/png&STYLE=default&bbox={bbox-epsg-3857}&width=256&height=256&crs=EPSG:3857&transparent=true'], - tileSize: 256, - attribution: '© swisstopo' + version: 8, + sources: { + swisstopoHikingClosures: { + type: 'raster', + tiles: ['https://wms.geo.admin.ch/?version=1.3.0&service=WMS&request=GetMap&sld_version=1.1.0&layers=ch.astra.wanderland-sperrungen_umleitungen&format=image/png&STYLE=default&bbox={bbox-epsg-3857}&width=256&height=256&crs=EPSG:3857&transparent=true'], + tileSize: 256, + attribution: '© swisstopo' + }, + }, + layers: [{ + id: 'swisstopoHikingClosures', + type: 'raster', + source: 'swisstopoHikingClosures', + }], }, swisstopoCycling: { - type: 'raster', - tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.astra.veloland/default/current/3857/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 18, - attribution: '© swisstopo' + version: 8, + sources: { + swisstopoCycling: { + type: 'raster', + tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.astra.veloland/default/current/3857/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 18, + attribution: '© swisstopo' + } + }, + layers: [{ + id: 'swisstopoCycling', + type: 'raster', + source: 'swisstopoCycling', + }], }, swisstopoCyclingClosures: { - type: 'raster', - tiles: ['https://wms.geo.admin.ch/?version=1.3.0&service=WMS&request=GetMap&sld_version=1.1.0&layers=ch.astra.veloland-sperrungen_umleitungen&format=image/png&STYLE=default&bbox={bbox-epsg-3857}&width=256&height=256&crs=EPSG:3857&transparent=true'], - tileSize: 256, - attribution: '© swisstopo' + version: 8, + sources: { + swisstopoCyclingClosures: { + type: 'raster', + tiles: ['https://wms.geo.admin.ch/?version=1.3.0&service=WMS&request=GetMap&sld_version=1.1.0&layers=ch.astra.veloland-sperrungen_umleitungen&format=image/png&STYLE=default&bbox={bbox-epsg-3857}&width=256&height=256&crs=EPSG:3857&transparent=true'], + tileSize: 256, + attribution: '© swisstopo' + } + }, + layers: [{ + id: 'swisstopoCyclingClosures', + type: 'raster', + source: 'swisstopoCyclingClosures', + }], }, swisstopoMountainBike: { - type: 'raster', - tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.astra.mountainbikeland/default/current/3857/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 18, - attribution: '© swisstopo' + version: 8, + sources: { + swisstopoMountainBike: { + type: 'raster', + tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.astra.mountainbikeland/default/current/3857/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 18, + attribution: '© swisstopo' + } + }, + layers: [{ + id: 'swisstopoMountainBike', + type: 'raster', + source: 'swisstopoMountainBike', + }], }, swisstopoMountainBikeClosures: { - type: 'raster', - tiles: ['https://wms.geo.admin.ch/?version=1.3.0&service=WMS&request=GetMap&sld_version=1.1.0&layers=ch.astra.mountainbikeland-sperrungen_umleitungen&format=image/png&STYLE=default&bbox={bbox-epsg-3857}&width=256&height=256&crs=EPSG:3857&transparent=true'], - tileSize: 256, - attribution: '© swisstopo' + version: 8, + sources: { + swisstopoMountainBikeClosures: { + type: 'raster', + tiles: ['https://wms.geo.admin.ch/?version=1.3.0&service=WMS&request=GetMap&sld_version=1.1.0&layers=ch.astra.mountainbikeland-sperrungen_umleitungen&format=image/png&STYLE=default&bbox={bbox-epsg-3857}&width=256&height=256&crs=EPSG:3857&transparent=true'], + tileSize: 256, + attribution: '© swisstopo' + } + }, + layers: [{ + id: 'swisstopoMountainBikeClosures', + type: 'raster', + source: 'swisstopoMountainBikeClosures', + }], }, swisstopoSkiTouring: { - type: 'raster', - tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.swisstopo-karto.skitouren/default/current/3857/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 17, - attribution: '© swisstopo' + version: 8, + sources: { + swisstopoSkiTouring: { + type: 'raster', + tiles: ['https://wmts.geo.admin.ch/1.0.0/ch.swisstopo-karto.skitouren/default/current/3857/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 17, + attribution: '© swisstopo' + } + }, + layers: [{ + id: 'swisstopoSkiTouring', + type: 'raster', + source: 'swisstopoSkiTouring', + }], }, ignFrCadastre: { - type: 'raster', - tiles: ['https://data.geopf.fr/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&TILEMATRIXSET=PM&TILEMATRIX={z}&TILECOL={x}&TILEROW={y}&LAYER=CADASTRALPARCELS.PARCELS&FORMAT=image/png&STYLE=normal'], - tileSize: 256, - maxzoom: 20, - attribution: 'IGN-F/Géoportail' + version: 8, + sources: { + ignFrCadastre: { + type: 'raster', + tiles: ['https://data.geopf.fr/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&TILEMATRIXSET=PM&TILEMATRIX={z}&TILECOL={x}&TILEROW={y}&LAYER=CADASTRALPARCELS.PARCELS&FORMAT=image/png&STYLE=normal'], + tileSize: 256, + maxzoom: 20, + attribution: 'IGN-F/Géoportail' + } + }, + layers: [{ + id: 'ignFrCadastre', + type: 'raster', + source: 'ignFrCadastre', + }], }, ignSlope: { - type: 'raster', - tiles: ['https://data.geopf.fr/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&TileMatrixSet=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&Layer=GEOGRAPHICALGRIDSYSTEMS.SLOPES.MOUNTAIN&FORMAT=image/png&Style=normal'], - tileSize: 256, - maxzoom: 17, - attribution: 'IGN-F/Géoportail' + version: 8, + sources: { + ignSlope: { + type: 'raster', + tiles: ['https://data.geopf.fr/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&TileMatrixSet=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&Layer=GEOGRAPHICALGRIDSYSTEMS.SLOPES.MOUNTAIN&FORMAT=image/png&Style=normal'], + tileSize: 256, + attribution: 'IGN-F/Géoportail' + } + }, + layers: [{ + id: 'ignSlope', + type: 'raster', + source: 'ignSlope', + }], }, ignSkiTouring: { - type: 'raster', - tiles: ['https://data.geopf.fr/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&TileMatrixSet=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&Layer=TRACES.RANDO.HIVERNALE&FORMAT=image/png&Style=normal'], - tileSize: 256, - maxzoom: 16, - attribution: 'IGN-F/Géoportail' + version: 8, + sources: { + ignSkiTouring: { + type: 'raster', + tiles: ['https://data.geopf.fr/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&TileMatrixSet=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&Layer=TRACES.RANDO.HIVERNALE&FORMAT=image/png&Style=normal'], + tileSize: 256, + maxzoom: 16, + attribution: 'IGN-F/Géoportail' + }, + }, + layers: [{ + id: 'ignSkiTouring', + type: 'raster', + source: 'ignSkiTouring', + }], }, waymarkedTrailsHiking: { - type: 'raster', - tiles: ['https://tile.waymarkedtrails.org/hiking/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 18, - attribution: '© Waymarked Trails' + version: 8, + sources: { + waymarkedTrailsHiking: { + type: 'raster', + tiles: ['https://tile.waymarkedtrails.org/hiking/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 18, + attribution: '© Waymarked Trails' + } + }, + layers: [{ + id: 'waymarkedTrailsHiking', + type: 'raster', + source: 'waymarkedTrailsHiking', + }], }, waymarkedTrailsCycling: { - type: 'raster', - tiles: ['https://tile.waymarkedtrails.org/cycling/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 18, - attribution: '© Waymarked Trails' + version: 8, + sources: { + waymarkedTrailsCycling: { + type: 'raster', + tiles: ['https://tile.waymarkedtrails.org/cycling/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 18, + attribution: '© Waymarked Trails' + } + }, + layers: [{ + id: 'waymarkedTrailsCycling', + type: 'raster', + source: 'waymarkedTrailsCycling', + }], }, waymarkedTrailsMTB: { - type: 'raster', - tiles: ['https://tile.waymarkedtrails.org/mtb/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 18, - attribution: '© Waymarked Trails' + version: 8, + sources: { + waymarkedTrailsMTB: { + type: 'raster', + tiles: ['https://tile.waymarkedtrails.org/mtb/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 18, + attribution: '© Waymarked Trails' + } + }, + layers: [{ + id: 'waymarkedTrailsMTB', + type: 'raster', + source: 'waymarkedTrailsMTB', + }], }, waymarkedTrailsSkating: { - type: 'raster', - tiles: ['https://tile.waymarkedtrails.org/skating/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 18, - attribution: '© Waymarked Trails' + version: 8, + sources: { + waymarkedTrailsSkating: { + type: 'raster', + tiles: ['https://tile.waymarkedtrails.org/skating/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 18, + attribution: '© Waymarked Trails' + } + }, + layers: [{ + id: 'waymarkedTrailsSkating', + type: 'raster', + source: 'waymarkedTrailsSkating', + }], }, waymarkedTrailsHorseRiding: { - type: 'raster', - tiles: ['https://tile.waymarkedtrails.org/riding/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 18, - attribution: '© Waymarked Trails' + version: 8, + sources: { + waymarkedTrailsHorseRiding: { + type: 'raster', + tiles: ['https://tile.waymarkedtrails.org/riding/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 18, + attribution: '© Waymarked Trails' + } + }, + layers: [{ + id: 'waymarkedTrailsHorseRiding', + type: 'raster', + source: 'waymarkedTrailsHorseRiding', + }], }, waymarkedTrailsWinter: { - type: 'raster', - tiles: ['https://tile.waymarkedtrails.org/slopes/{z}/{x}/{y}.png'], - tileSize: 256, - maxzoom: 18, - attribution: '© Waymarked Trails' + version: 8, + sources: { + waymarkedTrailsWinter: { + type: 'raster', + tiles: ['https://tile.waymarkedtrails.org/slopes/{z}/{x}/{y}.png'], + tileSize: 256, + maxzoom: 18, + attribution: '© Waymarked Trails' + } + }, + layers: [{ + id: 'waymarkedTrailsWinter', + type: 'raster', + source: 'waymarkedTrailsWinter', + }], }, }; @@ -463,9 +628,6 @@ export const basemapTree: LayerTreeType = { export const overlayTree: LayerTreeType = { overlays: { world: { - cyclOSM: { - cyclOSMlite: true, - }, waymarked_trails: { waymarkedTrailsHiking: true, waymarkedTrailsCycling: true, @@ -473,7 +635,9 @@ export const overlayTree: LayerTreeType = { waymarkedTrailsSkating: true, waymarkedTrailsHorseRiding: true, waymarkedTrailsWinter: true, - } + }, + cyclOSMlite: true, + bikerouterGravel: true, }, countries: { france: { @@ -547,9 +711,6 @@ export const defaultBasemap = 'mapboxOutdoors'; export const defaultOverlays = { overlays: { world: { - cyclOSM: { - cyclOSMlite: false, - }, waymarked_trails: { waymarkedTrailsHiking: false, waymarkedTrailsCycling: false, @@ -557,7 +718,9 @@ export const defaultOverlays = { waymarkedTrailsSkating: false, waymarkedTrailsHorseRiding: false, waymarkedTrailsWinter: false, - } + }, + cyclOSMlite: false, + bikerouterGravel: false, }, countries: { france: { @@ -683,9 +846,6 @@ export const defaultBasemapTree: LayerTreeType = { export const defaultOverlayTree: LayerTreeType = { overlays: { world: { - cyclOSM: { - cyclOSMlite: false, - }, waymarked_trails: { waymarkedTrailsHiking: true, waymarkedTrailsCycling: true, @@ -693,7 +853,9 @@ export const defaultOverlayTree: LayerTreeType = { waymarkedTrailsSkating: false, waymarkedTrailsHorseRiding: false, waymarkedTrailsWinter: false, - } + }, + cyclOSMlite: false, + bikerouterGravel: false, }, countries: { france: { diff --git a/website/src/lib/components/Map.svelte b/website/src/lib/components/Map.svelte index d810117a..e42a7527 100644 --- a/website/src/lib/components/Map.svelte +++ b/website/src/lib/components/Map.svelte @@ -1,331 +1,355 @@
{$_('webgl2_required')}
- -{$_('webgl2_required')}
+ +