Mercurial > gemma
changeset 1162:fae17a9dee9e
merge
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 13 Nov 2018 17:22:32 +0100 |
parents | e15850b3a9d1 (current diff) c8c26912754c (diff) |
children | fb5c83d4ea1d |
files | |
diffstat | 1 files changed, 52 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/map/Maplayer.vue Tue Nov 13 17:22:16 2018 +0100 +++ b/client/src/map/Maplayer.vue Tue Nov 13 17:22:32 2018 +0100 @@ -59,7 +59,7 @@ }, computed: { ...mapGetters("map", ["getLayerByName"]), - ...mapState("map", ["layers", "openLayersMap"]), + ...mapState("map", ["layers", "openLayersMap", "drawMode", "cutMode"]), ...mapState("bottlenecks", ["selectedSurvey"]), mapStyle() { return { @@ -70,63 +70,65 @@ }, methods: { identify(coordinate, pixel) { - this.$store.commit("map/setIdentifiedFeatures", []); - // checking our WFS layers - var features = this.openLayersMap.getFeaturesAtPixel(pixel); - if (features) { - this.$store.commit("map/setIdentifiedFeatures", features); + if (!this.drawMode && !this.cutMode) { + this.$store.commit("map/setIdentifiedFeatures", []); + // checking our WFS layers + var features = this.openLayersMap.getFeaturesAtPixel(pixel); + if (features) { + this.$store.commit("map/setIdentifiedFeatures", features); - // get selected bottleneck from identified features - for (let feature of features) { - let id = feature.getId(); - // RegExp.prototype.test() works with number, str and undefined - if (/^bottlenecks\./.test(id)) { - this.$store.dispatch( - "bottlenecks/setSelectedBottleneck", - feature.get("objnam") - ); - this.$store.commit("map/moveMap", { - coordinates: getCenter( - feature - .getGeometry() - .clone() - .transform("EPSG:3857", "EPSG:4326") - .getExtent() - ), - zoom: 17, - preventZoomOut: true - }); + // get selected bottleneck from identified features + for (let feature of features) { + let id = feature.getId(); + // RegExp.prototype.test() works with number, str and undefined + if (/^bottlenecks\./.test(id)) { + this.$store.dispatch( + "bottlenecks/setSelectedBottleneck", + feature.get("objnam") + ); + this.$store.commit("map/moveMap", { + coordinates: getCenter( + feature + .getGeometry() + .clone() + .transform("EPSG:3857", "EPSG:4326") + .getExtent() + ), + zoom: 17, + preventZoomOut: true + }); + } } } - } - // DEBUG output and example how to remove the GeometryName - /* - for (let feature of features) { - console.log("Identified:", feature.getId()); - for (let key of feature.getKeys()) { - if (key != feature.getGeometryName()) { - console.log(key, feature.get(key)); + // DEBUG output and example how to remove the GeometryName + /* + for (let feature of features) { + console.log("Identified:", feature.getId()); + for (let key of feature.getKeys()) { + if (key != feature.getGeometryName()) { + console.log(key, feature.get(key)); + } } } - } - */ + */ - // trying the GetFeatureInfo way for WMS - var wmsSource = this.getLayerByName( - "Inland ECDIS chart Danube" - ).data.getSource(); - var url = wmsSource.getGetFeatureInfoUrl( - coordinate, - 100 /* resolution */, - "EPSG:3857", - // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d - { INFO_FORMAT: "text/plain" } - ); + // trying the GetFeatureInfo way for WMS + var wmsSource = this.getLayerByName( + "Inland ECDIS chart Danube" + ).data.getSource(); + var url = wmsSource.getGetFeatureInfoUrl( + coordinate, + 100 /* resolution */, + "EPSG:3857", + // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d + { INFO_FORMAT: "text/plain" } + ); - if (url) { - // cannot directly query here because of SOP - console.log("GetFeatureInfo url:", url); + if (url) { + // cannot directly query here because of SOP + console.log("GetFeatureInfo url:", url); + } } }, buildVectorLoader(featureRequestOptions, endpoint, vectorSource) {