changeset 3259:985bc5009115

client: prevent mutual intefering between draw tools and identify tool on openlayers api level
author Markus Kottlaender <markus@intevation.de>
date Tue, 14 May 2019 19:29:45 +0200
parents 276fde700aa6
children 909a19e97db9
files client/src/store/map.js
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/store/map.js	Tue May 14 19:00:57 2019 +0200
+++ b/client/src/store/map.js	Tue May 14 19:29:45 2019 +0200
@@ -157,7 +157,8 @@
       const lineTool = new Draw({
         source: drawVectorSrc,
         type: "LineString",
-        maxPoints: 2
+        maxPoints: 2,
+        stopClick: true
       });
       lineTool.set("id", "linetool");
       lineTool.setActive(false);
@@ -182,7 +183,8 @@
       const polygonTool = new Draw({
         source: drawVectorSrc,
         type: "Polygon",
-        maxPoints: 50
+        maxPoints: 50,
+        stopClick: true
       });
       polygonTool.set("id", "polygontool");
       polygonTool.setActive(false);
@@ -212,6 +214,7 @@
         source: cutVectorSrc,
         type: "LineString",
         maxPoints: 2,
+        stopClick: true,
         style: new Style({
           stroke: new Stroke({
             color: "#444",
@@ -299,12 +302,6 @@
           toLonLat(event.coordinate, map.getView().getProjection())
         );
         state.mapPopup.setPosition(undefined);
-        if (
-          state.lineToolEnabled ||
-          state.polygonToolEnabled ||
-          state.cutToolEnabled
-        )
-          return;
         commit("setIdentifiedFeatures", []);
         // checking our WFS layers
         var features = map.getFeaturesAtPixel(event.pixel, { hitTolerance: 7 });