comparison client/src/store/map.js @ 4688:ad271887fd8d

Added FeatureInfo for sounding results including surtyp attribute.
author Raimund Renkert <raimund@renkert.org>
date Wed, 16 Oct 2019 13:43:30 +0200
parents dc9c150243df
children e51b9b265df0
comparison
equal deleted inserted replaced
4687:f73868037365 4688:ad271887fd8d
521 return feat; 521 return feat;
522 }); 522 });
523 commit("addIdentifiedFeatures", features); 523 commit("addIdentifiedFeatures", features);
524 }); 524 });
525 } 525 }
526 var srSource = map.getLayer("BOTTLENECKISOLINE").getSource();
527 var srUrl = srSource.getGetFeatureInfoUrl(
528 event.coordinate,
529 currentResolution /* resolution */,
530 "EPSG:3857",
531 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d
532 { INFO_FORMAT: "application/json" }
533 );
534
535 if (srUrl) {
536 HTTP.get(srUrl + "&BUFFER=5", {
537 headers: {
538 "X-Gemma-Auth": localStorage.getItem("token")
539 }
540 }).then(response => {
541 let features = response.data.features.map(f => {
542 let feat = new Feature({
543 geometry: new Point(f.geometry.coordinates)
544 });
545 feat.setId(f.id);
546 feat.setProperties(f.properties);
547 return feat;
548 });
549 commit("addIdentifiedFeatures", features);
550 });
551 }
526 }); 552 });
527 }, 553 },
528 refreshLayers({ state }) { 554 refreshLayers({ state }) {
529 state.openLayersMaps.forEach(map => { 555 state.openLayersMaps.forEach(map => {
530 let layers = map.getLayers().getArray(); 556 let layers = map.getLayers().getArray();