Mercurial > gemma
diff client/src/drawtool/Drawtool.vue @ 1144:5f98d0c9d738
linted code
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Mon, 12 Nov 2018 15:12:04 +0100 |
parents | 2e06bc53b002 |
children | 16d42e8183b3 |
line wrap: on
line diff
--- a/client/src/drawtool/Drawtool.vue Mon Nov 12 15:00:45 2018 +0100 +++ b/client/src/drawtool/Drawtool.vue Mon Nov 12 15:12:04 2018 +0100 @@ -56,28 +56,40 @@ name: "drawtool", computed: { ...mapGetters("map", ["getLayerByName"]), - ...mapState("map", ["drawMode", "drawTool", "cutMode", "cutTool", "openLayersMap"]), + ...mapState("map", [ + "drawMode", + "drawTool", + "cutMode", + "cutTool", + "openLayersMap" + ]), ...mapState("bottlenecks", ["selectedSurvey"]) }, methods: { toggleLineMode() { this.disableDrawTool(); this.disableCutTool(); - this.$store.commit("map/drawMode", this.drawMode !== "LineString" ? "LineString" : null); + this.$store.commit( + "map/drawMode", + this.drawMode !== "LineString" ? "LineString" : null + ); this.$store.commit("map/cutMode", null); if (this.drawMode) this.enableDrawTool(); }, togglePolygonMode() { this.disableDrawTool(); this.disableCutTool(); - this.$store.commit("map/drawMode", this.drawMode !== "Polygon" ? "Polygon" : null); + this.$store.commit( + "map/drawMode", + this.drawMode !== "Polygon" ? "Polygon" : null + ); this.$store.commit("map/cutMode", null); if (this.drawMode) this.enableDrawTool(); }, toggleCutMode() { this.disableCutTool(); this.disableDrawTool(); - this.$store.commit('map/cutMode', !this.cutMode); + this.$store.commit("map/cutMode", !this.cutMode); this.$store.commit("map/drawMode", null); if (this.cutMode) this.enableCutTool(); }, @@ -102,7 +114,9 @@ }, disableDrawTool() { this.$store.commit("map/setCurrentMeasurement", null); - this.getLayerByName("Draw Tool").data.getSource().clear(); + this.getLayerByName("Draw Tool") + .data.getSource() + .clear(); this.openLayersMap.removeInteraction(this.drawTool); this.$store.commit("map/drawTool", null); }, @@ -114,9 +128,10 @@ this.$store.commit("map/setCurrentMeasurement", { quantity: "Area", unitSymbol: areaSize > 100000 ? "km²" : "m²", - value: areaSize > 100000 - ? Math.round(areaSize / 1000) / 1000 // convert into 1 km² == 1000*1000 m² and round to 1000 m² - : Math.round(areaSize) + value: + areaSize > 100000 + ? Math.round(areaSize / 1000) / 1000 // convert into 1 km² == 1000*1000 m² and round to 1000 m² + : Math.round(areaSize) }); } if (this.drawMode === "LineString") { @@ -148,7 +163,9 @@ }, disableCutTool() { this.$store.commit("map/setCurrentMeasurement", null); - this.getLayerByName("Cut Tool").data.getSource().clear(); + this.getLayerByName("Cut Tool") + .data.getSource() + .clear(); this.openLayersMap.removeInteraction(this.cutTool); this.$store.commit("map/cutTool", null); }, @@ -220,7 +237,7 @@ transformedLine, featureCallback ); - }, + } } }; </script>