Skip to content

Commit

Permalink
reset mapoptions on click
Browse files Browse the repository at this point in the history
  • Loading branch information
Der-Alex-K committed Dec 20, 2024
1 parent 6fd1670 commit 37a4cd8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions frontend/src/components/map/ZaehlstelleMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ function setMarkerToMap() {
}
}
watch(
() => searchStore.getTriggerSearch,
() => {
mapOptionsStore.resetMapOptions();
map.setView(center.value, zoomValue.value);
}
);
function setZaehlartenmarkerToMap() {
const markers: Array<Marker> = [];
const zaehlartenKarte = selectedZaehlstelleKarte.value.zaehlartenKarte;
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/store/MapOptionsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ export const useMapOptionsStore = defineStore("mapOptionsStore", () => {

const getMapOptions = computed(() => mapOptions.value);

function setMapOptions(payload: MapOptions) {
function setMapOptions(payload: MapOptions | undefined) {
mapOptions.value = payload;
}

function resetMapOptions() {
mapOptions.value = undefined;
}

return {
getMapOptions,
setMapOptions,
resetMapOptions,
};
});

0 comments on commit 37a4cd8

Please sign in to comment.