diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-10-13 00:14:56 +0200 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-10-13 00:14:56 +0200 |
| commit | 2da9964e49e64c02767342d2de675b776e8e6cda (patch) | |
| tree | 71bdae38ccf86afb01a673c9a9f3c90421b5b64c /src/frontend/app/routes/map.tsx | |
| parent | 497a2893465bf0cd84cf6d3cc9023daba336f253 (diff) | |
Use openfreemapinstead of self-hosting, improve stop display, improve dark mode
Diffstat (limited to 'src/frontend/app/routes/map.tsx')
| -rw-r--r-- | src/frontend/app/routes/map.tsx | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/frontend/app/routes/map.tsx b/src/frontend/app/routes/map.tsx index 5887b9c..56a9c79 100644 --- a/src/frontend/app/routes/map.tsx +++ b/src/frontend/app/routes/map.tsx @@ -73,7 +73,8 @@ export default function StopMap() { }, []); useEffect(() => { - const styleName = "carto"; + //const styleName = "carto"; + const styleName = "openfreemap"; loadStyle(styleName, theme) .then((style) => setMapStyle(style)) .catch((error) => console.error("Failed to load map style:", error)); @@ -158,12 +159,33 @@ export default function StopMap() { source="stops-source" layout={{ "icon-image": "stop", - "icon-size": ["interpolate", ["linear"], ["zoom"], 11, 0.4, 16, 0.8], + "icon-size": ["interpolate", ["linear"], ["zoom"], 11, 0.4, 18, 0.8], "icon-allow-overlap": true, "icon-ignore-placement": true, }} /> + <Layer + id="stops-label" + type="symbol" + source="stops-source" + minzoom={16} + layout={{ + "text-field": ["get", "name"], + "text-font": ["Noto Sans Regular"], + "text-offset": [0, 2.5], + "text-anchor": "center", + "text-justify": "center", + "text-size": ["interpolate", ["linear"], ["zoom"], 11, 8, 22, 14] + }} + paint={{ + "text-color": "#45a15a", + "text-halo-color": "#fff", + "text-halo-width": 1.5 + }} + /> + + {selectedStop && ( <StopSheet isOpen={isSheetOpen} |
