Sattion öffnen (Tab) für polylines und Geräte funktioniert nicht zu 100% muss noch optimiert werden
This commit is contained in:
@@ -6,6 +6,7 @@ import "leaflet-contextmenu/dist/leaflet.contextmenu.css";
|
||||
import * as urls from "../config/urls.js";
|
||||
import * as layers from "../config/layers.js";
|
||||
import { addContextMenuToMarker, openInNewTab } from "../utils/contextMenuUtils";
|
||||
import { disablePolylineEvents, enablePolylineEvents } from "./mapFeatures"; // Importiere die Funktionen
|
||||
|
||||
export const initializeMap = (mapRef, setMap, setOms, setMenuItemAdded, addItemsToMapContextMenu, hasRights) => {
|
||||
const offlineTileLayer = urls.OFFLINE_TILE_LAYER;
|
||||
@@ -45,10 +46,10 @@ export const initializeMap = (mapRef, setMap, setOms, setMenuItemAdded, addItems
|
||||
console.log("Opening polyline link:", storedLink);
|
||||
window.open(storedLink, "_blank");
|
||||
}
|
||||
//} else if (lastElementType === "marker") {
|
||||
} else {
|
||||
const clickedMarker = e.relatedTarget;
|
||||
openInNewTab(e, clickedMarker);
|
||||
console.log("Opening marker link:", clickedMarker.options.link);
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -67,6 +68,11 @@ export const initializeMap = (mapRef, setMap, setOms, setMenuItemAdded, addItems
|
||||
setMap(initMap);
|
||||
setOms(overlappingMarkerSpiderfier);
|
||||
|
||||
// Polyline-Ereignisse aktivieren, wenn das Kontextmenü geschlossen wird
|
||||
initMap.on("contextmenu.close", function () {
|
||||
enablePolylineEvents(window.polylines, window.lineColors);
|
||||
});
|
||||
|
||||
initMap.on("zoomend", function () {
|
||||
if (initMap.getZoom() > 15) {
|
||||
initMap.setZoom(15);
|
||||
|
||||
Reference in New Issue
Block a user