Skip to content
Snippets Groups Projects
Commit b8549f5a authored by leandro's avatar leandro
Browse files

fix couches cartos

parent 1ee4a4bb
No related branches found
No related tags found
1 merge request!35fix couches cartos
......@@ -68,20 +68,25 @@ export default {
selectedLayer: {
get() {
const matchingLayer = this.retrieveLayer(this.layer.title);
return {
name: matchingLayer ? matchingLayer.service : "",
value: this.layer ? this.layer.title : "",
};
if (matchingLayer != undefined){
return {
name: matchingLayer != undefined ? matchingLayer.service : "",
value: this.layer ? this.layer.title : "",
};
}
return []
},
set(newValue) {
const matchingLayer = this.retrieveLayer(this.layer.title);
this.updateLayer({
...this.layer,
service: newValue.name,
title: newValue.value,
id: matchingLayer.id,
});
const matchingLayer = this.retrieveLayer(newValue.title);
if (matchingLayer != undefined){
this.updateLayer({
...this.layer,
service: newValue.name,
title: newValue.value,
id: matchingLayer.id,
});
}
},
},
......@@ -96,7 +101,7 @@ export default {
availableLayers: function () {
return this.layers.map((el) => {
return { name: el.service, value: el.title };
return { id: el.id, name: el.service, value: el.title, title: el.title };
});
},
......@@ -109,7 +114,7 @@ export default {
methods: {
retrieveLayer(title) {
return this.layers.find((el) => el.title === title);
return this.layers.find((el) => el.title === title);
},
removeLayer() {
......@@ -130,12 +135,14 @@ export default {
mounted() {
const matchingLayer = this.retrieveLayer(this.layer.title);
this.updateLayer({
...this.layer,
service: matchingLayer.service,
title: matchingLayer.title,
id: matchingLayer.id,
});
if (matchingLayer != undefined){
this.updateLayer({
...this.layer,
service: matchingLayer.service,
title: matchingLayer.title,
id: matchingLayer.id,
});
}
},
};
</script>
\ No newline at end of file
......@@ -99,7 +99,9 @@ const map = {
GET_BASEMAPS({ commit }, project_slug) {
return axios
.get(`${this.state.configuration.VUE_APP_DJANGO_API_BASE}base-maps/?project__slug=${project_slug}`)
.then((response) => (commit("SET_BASEMAPS", response.data)))
.then((response) => {
commit("SET_BASEMAPS", response.data)
})
.catch((error) => {
throw error;
});
......
......@@ -21,7 +21,7 @@
</a>
</div>
<div class="ui">
<div v-if="basemaps" class="ui">
<ProjectMappingBasemap
v-for="basemap in basemaps"
:key="basemap.id"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment