Files
nodeMap/utils/openInSameWindow.js
ISA c793e1c81c feat: Move openInSameWindow function to a separate file
- Moved the openInSameWindow function from MapComponent.js to a new file openInSameWindow.js in the utils directory.
- Updated MapComponent.js to import and use the openInSameWindow function from the new file.
- This change improves code modularity and readability.
2024-07-12 06:15:54 +02:00

11 lines
358 B
JavaScript

// utils/openInSameWindow.js
export function openInSameWindow(e, marker, baseUrl) {
if (marker && marker.options && marker.options.link) {
//console.log("Marker data:", baseUrl + marker.options.link);
window.location.href = baseUrl + marker.options.link;
} else {
console.error("Fehler: Marker hat keine gültige 'link' Eigenschaft");
}
}