diff --git a/src/store/modules/map.store.js b/src/store/modules/map.store.js index 9a5154da83e274256f2286911a22ed96064dc9f3..766ab39d9e3b08351979b6480ac1d7d9126b9338 100644 --- a/src/store/modules/map.store.js +++ b/src/store/modules/map.store.js @@ -118,10 +118,8 @@ const map = { // - if one basemap exists, check in the localstorage if one active basemap is set // - if no current active basemap, get the first index // - if not, load the default map and service options - - // todo : create endpoints to get : 'baseMaps' ,'layers' ,'serviceMap' ,'optionsMap' let layersToLoad = null; - if (state.baseMaps && state.baseMaps.length > 0) { + if (state.basemaps && state.basemaps.length > 0) { // Use active one if exists, otherwise index 0 (first basemap in the list) const mapOptions = JSON.parse(localStorage.getItem('geocontrib-map-options')) || {}; @@ -131,7 +129,7 @@ const map = { mapOptions[project]['current-basemap-index'] ? mapOptions[project]['current-basemap-index'] : 0; - layersToLoad = state.baseMaps[basemapIndex].layers; + layersToLoad = state.basemaps[basemapIndex].layers; layersToLoad.forEach((layerToLoad) => { state.availableLayers.forEach((layer) => { if (layer.id === layerToLoad.id) { diff --git a/src/views/project/Project_mapping.vue b/src/views/project/Project_mapping.vue index ff4c03513e883b223f5b9cfcbe22331ca74d2940..ef042222d0709cec8292904a0c0371883c347027 100644 --- a/src/views/project/Project_mapping.vue +++ b/src/views/project/Project_mapping.vue @@ -88,8 +88,9 @@ export default { }, created() { - if (!this.$store.getters.project) { - this.$store.dispatch('GET_PROJECT_INFO', this.$route.params.slug); + if (!this.$store.state.projects.project) { + this.$store.dispatch('projects/GET_PROJECT', this.$route.params.slug); + this.$store.dispatch('projects/GET_PROJECT_INFO', this.$route.params.slug); } },