diff --git a/next.config.js b/next.config.js index 4247713..41f8c66 100644 --- a/next.config.js +++ b/next.config.js @@ -49,9 +49,9 @@ const nextConfig = { "default-src 'self'", "script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:", "style-src 'self' 'unsafe-inline'", - "img-src 'self' data: blob: https://*.tile.openstreetmap.org https://api.maptiler.com http://localhost:9000 http://minio:9000", + "img-src 'self' data: blob: https://*.tile.openstreetmap.org https://api.maptiler.com https://server.arcgisonline.com https://wmts.geo.admin.ch https://wmts0.geo.admin.ch https://wmts1.geo.admin.ch https://wmts2.geo.admin.ch https://wmts3.geo.admin.ch https://wmts4.geo.admin.ch http://localhost:9000 http://minio:9000", "font-src 'self' data:", - "connect-src 'self' ws: wss: https://api.maptiler.com https://*.tile.openstreetmap.org https://api.open-meteo.com", + "connect-src 'self' ws: wss: https://api.maptiler.com https://*.tile.openstreetmap.org https://api.open-meteo.com https://server.arcgisonline.com https://wmts.geo.admin.ch https://wmts0.geo.admin.ch https://wmts1.geo.admin.ch https://wmts2.geo.admin.ch https://wmts3.geo.admin.ch https://wmts4.geo.admin.ch", "frame-ancestors 'self'", "base-uri 'self'", "form-action 'self'", diff --git a/src/components/map/map-view.tsx b/src/components/map/map-view.tsx index f6fd80a..e077293 100644 --- a/src/components/map/map-view.tsx +++ b/src/components/map/map-view.tsx @@ -106,7 +106,7 @@ export function MapView({ const measureMarkersRef = useRef([]) const measureCoordsRef = useRef([]) const [isMapLoaded, setIsMapLoaded] = useState(false) - const [isSatellite, setIsSatellite] = useState(false) + const [activeBaseLayer, setActiveBaseLayer] = useState<'osm' | 'satellite' | 'swisstopo' | 'swissimage'>('osm') const [measurePointCount, setMeasurePointCount] = useState(0) const [measureFinished, setMeasureFinished] = useState(false) const [drawingPointCount, setDrawingPointCount] = useState(0) @@ -689,6 +689,24 @@ export function MapView({ attribution: '© Esri, Maxar, Earthstar Geographics', maxzoom: 19, }, + 'swisstopo': { + type: 'raster', + tiles: [ + 'https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/{z}/{x}/{y}.jpeg', + ], + tileSize: 256, + attribution: '© swisstopo', + maxzoom: 18, + }, + 'swissimage': { + type: 'raster', + tiles: [ + 'https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swissimage/default/current/3857/{z}/{x}/{y}.jpeg', + ], + tileSize: 256, + attribution: '© swisstopo SWISSIMAGE', + maxzoom: 20, + }, }, layers: [ { @@ -702,6 +720,18 @@ export function MapView({ source: 'satellite', layout: { visibility: 'none' }, }, + { + id: 'swisstopo', + type: 'raster', + source: 'swisstopo', + layout: { visibility: 'none' }, + }, + { + id: 'swissimage', + type: 'raster', + source: 'swissimage', + layout: { visibility: 'none' }, + }, ], }, center: [initialCenter.lng, initialCenter.lat], @@ -2109,28 +2139,38 @@ export function MapView({ )} - {/* Layer toggle: OSM / Satellite */} + {/* Layer toggle: cycle through base maps */} {/* Zeichnung abschliessen Button (Linie/Polygon/Pfeil) */}