diff --git a/components/MapComponent.js b/components/MapComponent.js index 979bfffbc..64cafce7d 100644 --- a/components/MapComponent.js +++ b/components/MapComponent.js @@ -15,6 +15,7 @@ import { gisSystemStaticState } from "../store/gisSystemState"; import { mapLayersState } from "../store/mapLayersState"; import { selectedAreaState } from "../store/selectedAreaState"; import { zoomTriggerState } from "../store/zoomTriggerState"; +import { poiTypState } from '../store/poiTypState'; const MapComponent = ({ locations, onLocationUpdate }) => { const poiLayerRef = useRef(null); // Referenz auf die Layer-Gruppe für Datenbank-Marker @@ -197,10 +198,9 @@ const MapComponent = ({ locations, onLocationUpdate }) => { }, []); // Dependency-Array ist leer, um den Effekt nur beim Mount auszuführen //------------------------------------------ - const offlineTileLayer = "../TileMap/mapTiles/{z}/{x}/{y}.png"; // ich habe kein mapTiles lokal - const onlineTileLayer = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"; - //const onlineTileLayer = "mapTiles/{z}/{x}/{y}.png"; // auf dem Server local - //const onlineTileLayer = "TileMap/mapTiles/{z}/{x}/{y}.png"; + const offlineTileLayer = "../TileMap/mapTiles/{z}/{x}/{y}.png"; + //const onlineTileLayer = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"; + const onlineTileLayer = "mapTiles/{z}/{x}/{y}.png"; // Create map layers const TALAS = new L.layerGroup(); const ECI = new L.layerGroup(); @@ -288,14 +288,15 @@ const MapComponent = ({ locations, onLocationUpdate }) => { setMap(initMap); setOms(oms); - initMap.on("zoomend", function () { - // Überprüfen, ob der aktuelle Zoom außerhalb der Grenzen liegt - if (initMap.getZoom() > 15) { - initMap.setZoom(15); - } else if (initMap.getZoom() < 5) { - initMap.setZoom(5); - } - }); + initMap.on('zoomend', function() { + // Überprüfen, ob der aktuelle Zoom außerhalb der Grenzen liegt + if (initMap.getZoom() > 15) { + initMap.setZoom(15); + } else if (initMap.getZoom() < 5) { + initMap.setZoom(5); + } + }); + // Nach der Initialisierung der Map und Setzen im State kannst du Funktionen aufrufen, die `map` benötigen. initMap.whenReady(() => { @@ -390,7 +391,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { const popupContent = L.DomUtil.create("div"); popupContent.innerHTML = `