comparison client/src/application/Morphtool.vue @ 836:0b994949a4a0

client: make Morphtool selection more robust * Check if the selected features we are testing has an id before operating on it.
author Bernhard Reiter <bernhard@intevation.de>
date Fri, 28 Sep 2018 10:17:11 +0200
parents 797063af6dc8
children b1489669ba52
comparison
equal deleted inserted replaced
834:232f3f345cf0 836:0b994949a4a0
63 ...mapGetters("application", ["drawMode"]), 63 ...mapGetters("application", ["drawMode"]),
64 ...mapState("mapstore", ["identifiedFeatures", "selectedMorph"]), 64 ...mapState("mapstore", ["identifiedFeatures", "selectedMorph"]),
65 selectedBottleneck: function() { 65 selectedBottleneck: function() {
66 if (this.identifiedFeatures) { 66 if (this.identifiedFeatures) {
67 for (let feature of this.identifiedFeatures) { 67 for (let feature of this.identifiedFeatures) {
68 if (feature.getId().replace(/[.][^.]*$/, "") === "bottlenecks") { 68 let id = feature.getId();
69 if (id && id.replace(/[.][^.]*$/, "") === "bottlenecks") {
69 return feature; 70 return feature;
70 } 71 }
71 } 72 }
72 } 73 }
73 return null; 74 return null;
83 } 84 }
84 } 85 }
85 }, 86 },
86 methods: { 87 methods: {
87 queryBottleneck(name) { 88 queryBottleneck(name) {
89 // DEBUG console.log("starting to query bottleneck", name);
88 HTTP.get("/surveys/" + name, { 90 HTTP.get("/surveys/" + name, {
89 headers: { 91 headers: {
90 "X-Gemma-Auth": localStorage.getItem("token"), 92 "X-Gemma-Auth": localStorage.getItem("token"),
91 "Content-type": "text/xml; charset=UTF-8" 93 "Content-type": "text/xml; charset=UTF-8"
92 } 94 }