extensive changes
This commit is contained in:
@@ -1,19 +1,36 @@
|
||||
import { defineStore, acceptHMRUpdate } from 'pinia';
|
||||
import { favorites } from 'constants/favorites'
|
||||
|
||||
interface State {
|
||||
zoom: number
|
||||
center: [number, number]
|
||||
markerLatLng: [number, number]
|
||||
center: [number, number] | [null, null] | null
|
||||
markerLatLng: [number, number] | [null, null] | null
|
||||
qLocDrawer: boolean
|
||||
}
|
||||
|
||||
export const useLeafletStore = defineStore('leaflet', {
|
||||
state: (): State => {
|
||||
return {
|
||||
zoom: 10,
|
||||
center: [40.71278, -74.00594],
|
||||
markerLatLng: [40.71278, -74.00594],
|
||||
center: [favorites.home.coords.lat, favorites.home.coords.lng],
|
||||
markerLatLng: null,
|
||||
qLocDrawer: false,
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setCenter(lat: number, lng: number) {
|
||||
this.center = [lat, lng];
|
||||
},
|
||||
setZoom(zoom: number) {
|
||||
this.zoom = zoom;
|
||||
},
|
||||
setMarkerLatLng(lat: number, lng: number) {
|
||||
this.markerLatLng = [lat, lng];
|
||||
},
|
||||
toggleQLocDrawer() {
|
||||
this.qLocDrawer = !this.qLocDrawer
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (import.meta.hot) {
|
||||
|
||||
Reference in New Issue
Block a user