# HG changeset patch # User Bernhard Reiter # Date 1538122631 -7200 # Node ID 0b994949a4a06f3ca624c74c6c0351d12077fb9e # Parent 232f3f345cf08d3ac0b710c54b8db45643155cda client: make Morphtool selection more robust * Check if the selected features we are testing has an id before operating on it. diff -r 232f3f345cf0 -r 0b994949a4a0 client/src/application/Morphtool.vue --- a/client/src/application/Morphtool.vue Fri Sep 28 10:13:54 2018 +0200 +++ b/client/src/application/Morphtool.vue Fri Sep 28 10:17:11 2018 +0200 @@ -65,7 +65,8 @@ selectedBottleneck: function() { if (this.identifiedFeatures) { for (let feature of this.identifiedFeatures) { - if (feature.getId().replace(/[.][^.]*$/, "") === "bottlenecks") { + let id = feature.getId(); + if (id && id.replace(/[.][^.]*$/, "") === "bottlenecks") { return feature; } } @@ -85,6 +86,7 @@ }, methods: { queryBottleneck(name) { + // DEBUG console.log("starting to query bottleneck", name); HTTP.get("/surveys/" + name, { headers: { "X-Gemma-Auth": localStorage.getItem("token"), diff -r 232f3f345cf0 -r 0b994949a4a0 client/src/map/store.js --- a/client/src/map/store.js Fri Sep 28 10:13:54 2018 +0200 +++ b/client/src/map/store.js Fri Sep 28 10:17:11 2018 +0200 @@ -169,6 +169,8 @@ isVisible: true } ], + // note that some identified features may not have an id + // especially related to drawing in our own vector layer identifiedFeatures: [], currentMeasurement: null, selectedMorph: null