EXPORT CONFIG ! fin du centre de ressource
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user