From 369202ec42f88c3fc9f5a9aaf26aba1b1e6e4044 Mon Sep 17 00:00:00 2001 From: Christian Beutel <> Date: Sat, 21 Jun 2025 13:44:11 +0200 Subject: [PATCH] fixes map attribution && adds OpenFreeMap --- docs/src/content/docs/use/customize-map.md | 4 ++-- .../trail/map_with_elevation_maplibre.svelte | 8 +++---- .../components/trail/trail_info_panel.svelte | 2 +- web/static/styles/osm.json | 22 ------------------- web/static/styles/otm.json | 3 ++- 5 files changed, 9 insertions(+), 30 deletions(-) delete mode 100644 web/static/styles/osm.json diff --git a/docs/src/content/docs/use/customize-map.md b/docs/src/content/docs/use/customize-map.md index cf9b29b8..2d184d2f 100644 --- a/docs/src/content/docs/use/customize-map.md +++ b/docs/src/content/docs/use/customize-map.md @@ -4,8 +4,8 @@ description: How to customize the map with user defined tile sets --- wanderer 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 -2. Open Topo Maps +1. OpenFreeMap +2. OpenTopoMap 3. CARTO Light 4. CARTO Dark diff --git a/web/src/lib/components/trail/map_with_elevation_maplibre.svelte b/web/src/lib/components/trail/map_with_elevation_maplibre.svelte index 2708afa3..afcd404e 100644 --- a/web/src/lib/components/trail/map_with_elevation_maplibre.svelte +++ b/web/src/lib/components/trail/map_with_elevation_maplibre.svelte @@ -866,12 +866,12 @@ }), ), { - text: "Open Street Maps", - value: "/styles/osm.json", + text: "OpenFreeMap", + value: "https://tiles.openfreemap.org/styles/liberty", thumbnail: "https://tile.openstreetmap.org/1/0/0.png", }, { - text: "Open Topo Maps", + text: "OpenTopoMap", value: "/styles/otm.json", thumbnail: "https://tile.opentopomap.org/1/0/0.png", }, @@ -907,7 +907,7 @@ mapStyles[preferredMapStyleIndex].value ?? mapStyles[0].value, center: [initialState.lng, initialState.lat], - zoom: initialState.zoom, + zoom: initialState.zoom }, ...mapOptions, }; diff --git a/web/src/lib/components/trail/trail_info_panel.svelte b/web/src/lib/components/trail/trail_info_panel.svelte index ab72c3d4..1f0e054d 100644 --- a/web/src/lib/components/trail/trail_info_panel.svelte +++ b/web/src/lib/components/trail/trail_info_panel.svelte @@ -658,7 +658,7 @@ elevationProfileContainer={"epc-container"} showStyleSwitcher={false} showFullscreen={true} - mapOptions={{ attributionControl: false }} + mapOptions={{ attributionControl: {compact: true} }} onfullscreen={toggleMapFullScreen} bind:markers > diff --git a/web/static/styles/osm.json b/web/static/styles/osm.json deleted file mode 100644 index 39c2504f..00000000 --- a/web/static/styles/osm.json +++ /dev/null @@ -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 - } - ] -} \ No newline at end of file diff --git a/web/static/styles/otm.json b/web/static/styles/otm.json index f2a058ab..b10144c5 100644 --- a/web/static/styles/otm.json +++ b/web/static/styles/otm.json @@ -6,7 +6,8 @@ "tiles": [ "https://tile.opentopomap.org/{z}/{x}/{y}.png" ], - "tileSize": 256 + "tileSize": 256, + "attribution": "© OpenTopoMap" } }, "glyphs": "https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf",