Skip to content
Snippets Groups Projects
Commit 7ad9ed59 authored by DESPRES Damien's avatar DESPRES Damien
Browse files

show offline features in red

parent 58a5a905
No related branches found
No related tags found
No related merge requests found
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
{{ feature.properties.updated_on }} {{ feature.properties.updated_on }}
</td> </td>
<td class="center" v-if="user"> <td class="center" v-if="user">
{{ feature.properties.creator.username || " ---- " }} {{ getUserName(feature) }}
</td> </td>
</tr> </tr>
<tr v-if="filteredFeatures.length === 0" class="odd"> <tr v-if="filteredFeatures.length === 0" class="odd">
...@@ -288,6 +288,12 @@ export default { ...@@ -288,6 +288,12 @@ export default {
}, },
methods: { methods: {
getUserName(feature){
if(!feature.properties.creator) {
return " ---- ";
}
return feature.properties.creator.username || " ---- "
},
getFeatureDisplayName(feature) { getFeatureDisplayName(feature) {
return feature.properties.title || feature.id; return feature.properties.title || feature.id;
}, },
......
...@@ -663,10 +663,13 @@ export default { ...@@ -663,10 +663,13 @@ export default {
this.$store.dispatch("map/INITIATE_MAP"); this.$store.dispatch("map/INITIATE_MAP");
const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature/?output=geojson`; const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature/?output=geojson`;
let self = this; let self = this;
this.checkForOfflineFeature();
axios axios
.get(url) .get(url)
.then((response) => { .then((response) => {
const features = response.data.features; let features = response.data.features;
self.arraysOffline.forEach(x=>x.geojson.properties.color="red");
features=response.data.features.concat(self.arraysOffline.map(x=>x.geojson));
const featureGroup = mapUtil.addFeatures(features); const featureGroup = mapUtil.addFeatures(features);
if (featureGroup && featureGroup.getLayers().length > 0) { if (featureGroup && featureGroup.getLayers().length > 0) {
mapUtil mapUtil
...@@ -678,7 +681,7 @@ export default { ...@@ -678,7 +681,7 @@ export default {
.catch((error) => { .catch((error) => {
throw error; throw error;
}); });
this.checkForOfflineFeature();
} }
......
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