Mit Spider funktioniert etwas, es soll noch beim Klick wieder ausgeblendet werden
This commit is contained in:
@@ -323,6 +323,10 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||
}).addTo(initialMap);
|
||||
|
||||
const newOms = new OverlappingMarkerSpiderfier(initialMap, {
|
||||
nearbyDistance: 50,
|
||||
});
|
||||
setOms(newOms);
|
||||
setMap(initialMap);
|
||||
}
|
||||
}, [mapRef, map]);
|
||||
@@ -644,7 +648,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
||||
//Informationen in Tooltips einfügen
|
||||
// Marker hinzufügen für GisStationsStaticDistrict
|
||||
useEffect(() => {
|
||||
if (map && GisStationsStaticDistrict.length > 0) {
|
||||
if (map && oms && GisStationsStaticDistrict.length > 0) {
|
||||
map.eachLayer((layer) => {
|
||||
if (layer instanceof L.Marker) {
|
||||
map.removeLayer(layer);
|
||||
@@ -686,9 +690,9 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
||||
shadowSize: [41, 41],
|
||||
}),
|
||||
});
|
||||
//oms.addMarker(marker); // Marker zum OMS hinzufügen
|
||||
marker.addTo(map);
|
||||
|
||||
marker.addTo(map);
|
||||
oms.addMarker(marker); // Add marker to the OverlappingMarkerSpiderfier instance
|
||||
marker.on("mouseover", function (e) {
|
||||
this.openPopup();
|
||||
});
|
||||
@@ -704,7 +708,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
||||
.openPopup();
|
||||
});
|
||||
}
|
||||
}, [map, GisStationsStaticDistrict, GisStationsStatusDistrict]); // Include GisStationsStatusDistrict in dependencies
|
||||
}, [map, GisStationsStaticDistrict, oms, GisStationsStatusDistrict]); // Include GisStationsStatusDistrict in dependencies
|
||||
|
||||
//------------------------------------------
|
||||
// Funktion, die den Pfad zum entsprechenden Icon basierend auf dem Status generiert
|
||||
|
||||
Reference in New Issue
Block a user