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.
This commit is contained in:
ISA
2024-07-12 06:15:54 +02:00
parent 21d5932b8b
commit c793e1c81c
2 changed files with 11 additions and 11 deletions

10
utils/openInSameWindow.js Normal file
View File

@@ -0,0 +1,10 @@
// 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");
}
}