diff --git a/src/store/modules/map.store.js b/src/store/modules/map.store.js index 083f852da9448d883304e01d92baf05f5bdc7164..8129a2c6068ee302dd1a6d653e64aa9104069b5d 100644 --- a/src/store/modules/map.store.js +++ b/src/store/modules/map.store.js @@ -104,8 +104,7 @@ const map = { }); }, - INITIATE_MAP({ state, rootState, commit }, el) { - const project = rootState.projects.project; + INITIATE_MAP({ commit }, el) { //! since this function is not anymore called in different components, it would better to move it in project_details.vue let mapDefaultViewCenter = [46, 2]; // defaultMapView.center; let mapDefaultViewZoom = 5; // defaultMapView.zoom; mapUtil.createMap(el, { @@ -114,33 +113,8 @@ const map = { }); commit('SET_MAP', mapUtil.getMap()); - // Load the layers. - // - 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 - let layersToLoad = null; - 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')) || {}; - const basemapIndex = - mapOptions && - mapOptions[project] && - mapOptions[project]['current-basemap-index'] - ? mapOptions[project]['current-basemap-index'] - : 0; - layersToLoad = state.basemaps[basemapIndex].layers; - layersToLoad.forEach((layerToLoad) => { - state.availableLayers.forEach((layer) => { - if (layer.id === layerToLoad.id) { - layerToLoad = Object.assign(layerToLoad, layer); - } - }); - }); - layersToLoad.reverse(); - } mapUtil.addLayers( - layersToLoad, + null, this.state.configuration.DEFAULT_BASE_MAP_SERVICE, this.state.configuration.DEFAULT_BASE_MAP_OPTIONS, this.state.configuration.DEFAULT_BASE_MAP_SCHEMA_TYPE,