forked from geolba/tethys.backend
Arno Kaimbacher
a744ae7e5b
- add draw.component.vue - only load needed leaflet classes into map.component.vue an Submitter/Create.vue - rename js/store.Map.ts to js/Stores/map.service.ts -
47 lines
1018 B
TypeScript
47 lines
1018 B
TypeScript
import { defineStore } from 'pinia';
|
|
// import axios from 'axios';
|
|
|
|
|
|
export const MapService = defineStore('map', {
|
|
state: () => ({
|
|
|
|
// dataset: {} as Dataset,
|
|
|
|
mapService: new Map<string, any>(),
|
|
|
|
}),
|
|
actions: {
|
|
// payload = authenticated user
|
|
setUser(payload) {
|
|
if (payload.name) {
|
|
this.userName = payload.name;
|
|
}
|
|
if (payload.email) {
|
|
this.userEmail = payload.email;
|
|
}
|
|
if (payload.avatar) {
|
|
this.userAvatar = payload.avatar;
|
|
}
|
|
},
|
|
|
|
getMap(id: string) {
|
|
return this.mapService.get(id);
|
|
},
|
|
|
|
setMap(id: string, map) {
|
|
this.mapService.set(id, map);
|
|
|
|
},
|
|
|
|
hasMap(id: string): boolean {
|
|
return this.mapService.has(id);
|
|
},
|
|
|
|
deleteMap(id: string): boolean {
|
|
return this.mapService.delete(id);
|
|
},
|
|
|
|
|
|
},
|
|
});
|