fixes map attribution && adds OpenFreeMap

This commit is contained in:
Christian Beutel
2025-06-21 13:44:11 +02:00
parent b5a3864f04
commit 369202ec42
5 changed files with 9 additions and 30 deletions

View File

@@ -4,8 +4,8 @@ description: How to customize the map with user defined tile sets
--- ---
<span class="-tracking-[0.075em]">wanderer</span> is compatible with any provider of vector tile maps (e.g. CARTO, mapbox, maptiler, or self-hosted OpenMapTiles). Out of the box it comes with 4 different map styles: <span class="-tracking-[0.075em]">wanderer</span> is compatible with any provider of vector tile maps (e.g. CARTO, mapbox, maptiler, or self-hosted OpenMapTiles). Out of the box it comes with 4 different map styles:
1. Open Street Maps 1. OpenFreeMap
2. Open Topo Maps 2. OpenTopoMap
3. CARTO Light 3. CARTO Light
4. CARTO Dark 4. CARTO Dark

View File

@@ -866,12 +866,12 @@
}), }),
), ),
{ {
text: "Open Street Maps", text: "OpenFreeMap",
value: "/styles/osm.json", value: "https://tiles.openfreemap.org/styles/liberty",
thumbnail: "https://tile.openstreetmap.org/1/0/0.png", thumbnail: "https://tile.openstreetmap.org/1/0/0.png",
}, },
{ {
text: "Open Topo Maps", text: "OpenTopoMap",
value: "/styles/otm.json", value: "/styles/otm.json",
thumbnail: "https://tile.opentopomap.org/1/0/0.png", thumbnail: "https://tile.opentopomap.org/1/0/0.png",
}, },
@@ -907,7 +907,7 @@
mapStyles[preferredMapStyleIndex].value ?? mapStyles[preferredMapStyleIndex].value ??
mapStyles[0].value, mapStyles[0].value,
center: [initialState.lng, initialState.lat], center: [initialState.lng, initialState.lat],
zoom: initialState.zoom, zoom: initialState.zoom
}, },
...mapOptions, ...mapOptions,
}; };

View File

@@ -658,7 +658,7 @@
elevationProfileContainer={"epc-container"} elevationProfileContainer={"epc-container"}
showStyleSwitcher={false} showStyleSwitcher={false}
showFullscreen={true} showFullscreen={true}
mapOptions={{ attributionControl: false }} mapOptions={{ attributionControl: {compact: true} }}
onfullscreen={toggleMapFullScreen} onfullscreen={toggleMapFullScreen}
bind:markers bind:markers
></MapWithElevationMaplibre> ></MapWithElevationMaplibre>

View File

@@ -1,22 +0,0 @@
{
"version": 8,
"sources": {
"osm-tiles": {
"type": "raster",
"tiles": [
"https://tile.openstreetmap.org/{z}/{x}/{y}.png"
],
"tileSize": 256
}
},
"glyphs": "https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf",
"layers": [
{
"id": "osm-tiles",
"type": "raster",
"source": "osm-tiles",
"minzoom": 0,
"maxzoom": 19
}
]
}

View File

@@ -6,7 +6,8 @@
"tiles": [ "tiles": [
"https://tile.opentopomap.org/{z}/{x}/{y}.png" "https://tile.opentopomap.org/{z}/{x}/{y}.png"
], ],
"tileSize": 256 "tileSize": 256,
"attribution": "© OpenTopoMap"
} }
}, },
"glyphs": "https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf", "glyphs": "https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf",