Mercurial > gemma
comparison client/src/morphtool/Morphtool.vue @ 1063:7ec2133c6404
client: add area measurement. simpify code
* Add a third draw mode which can only be activated when no
morphology is selected and we are already in LineString mode.
It adds an area calculation. Because the Polygon drawMode ends
on a double click, there needs to be an extra callback for this to
run identify so that the area calculation is shown all times.
* Add Bernhard as author to some files and also simplify copyright
note.
* Remove DRAWMODES in the code to simplify as this is just one
indirection used once in stores/application.js.
* Use mapState instead mapGetters to get the drawMode at all places
to save some code lines.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Thu, 25 Oct 2018 23:16:53 +0200 |
parents | 04a9e78dcc5f |
children | 907321455f39 |
comparison
equal
deleted
inserted
replaced
1062:d3bdad8ed8d3 | 1063:7ec2133c6404 |
---|---|
104 * Software engineering by Intevation GmbH | 104 * Software engineering by Intevation GmbH |
105 * | 105 * |
106 * Author(s): | 106 * Author(s): |
107 * Thomas Junk <thomas.junk@intevation.de> | 107 * Thomas Junk <thomas.junk@intevation.de> |
108 */ | 108 */ |
109 import { mapGetters, mapState } from "vuex"; | 109 import { mapState } from "vuex"; |
110 | 110 |
111 import { displayError } from "../application/lib/errors.js"; | 111 import { displayError } from "../application/lib/errors.js"; |
112 import { HTTP } from "../application/lib/http"; | 112 import { HTTP } from "../application/lib/http"; |
113 | 113 |
114 export default { | 114 export default { |
118 surveyList: null, | 118 surveyList: null, |
119 bottleneckName: "" | 119 bottleneckName: "" |
120 }; | 120 }; |
121 }, | 121 }, |
122 computed: { | 122 computed: { |
123 ...mapGetters("application", ["drawMode"]), | 123 ...mapState("application", ["drawMode"]), |
124 ...mapState("identifystore", ["identifiedFeatures"]), | 124 ...mapState("identifystore", ["identifiedFeatures"]), |
125 ...mapState("fairwayprofile", ["selectedMorph"]), | 125 ...mapState("fairwayprofile", ["selectedMorph"]), |
126 selectedBottleneck: function() { | 126 selectedBottleneck: function() { |
127 if (this.identifiedFeatures && !this.drawMode) { | 127 if (this.identifiedFeatures && !this.drawMode) { |
128 for (let feature of this.identifiedFeatures) { | 128 for (let feature of this.identifiedFeatures) { |