EXPORT CONFIG ! fin du centre de ressource

This commit is contained in:
2025-04-02 01:06:39 +02:00
parent 7792005403
commit 7387ce7f50
9 changed files with 155 additions and 97 deletions

View File

@@ -23,21 +23,15 @@ export const useMapStore = defineStore('mapState', {
this.maxZoom,
{ animate: this.animationsAreEnabled, duration: this.animationDuration });
this.currentZoom = this.maxZoom;
this.lockMap();
},
resetMap(animate = this.animationsAreEnabled, duration = this.animationDuration) {
resetMap(animate = this.animationsAreEnabled, duration = this.animationDuration) {
this.map.flyTo(
this.defaultMapCenter,
useLayoutStore().isDesktop ? this.defaultZoomDesktop : this.defaultZoomMobile,
{ animate, duration });
this.currentZoom = useLayoutStore().isDesktop ? this.defaultZoomDesktop : this.defaultZoomMobile;
this.unlockMap();
},
lockMap() {
setTimeout(() => {
this.map.options.minZoom = this.currentZoom;
this.map.options.maxZoom = this.currentZoom;
}, this.animationDuration * 1000 + 100);
lockMap() {
this.map.dragging.disable();
this.map.touchZoom.disable();
this.map.doubleClickZoom.disable();