# HG changeset patch # User Raimund Renkert # Date 1549898392 -3600 # Node ID 826fc7309370f3c7836334f3507a1b40917a809d # Parent b27edd1f2353deac047f33b738843ee6f1c597a0 client: Added refresh button to reload the WFS layer data. diff -r b27edd1f2353 -r 826fc7309370 client/src/components/Maplayer.vue --- a/client/src/components/Maplayer.vue Mon Feb 11 16:16:35 2019 +0100 +++ b/client/src/components/Maplayer.vue Mon Feb 11 16:19:52 2019 +0100 @@ -183,35 +183,41 @@ // load different fairway dimension layers (level of service) ["1", "2", "3"].forEach(los => { - // loading the full WFS layer, by not setting the loader function - // and without bboxStrategy - var featureRequest = new WFS().writeGetFeature({ - srsName: "EPSG:3857", - featureNS: "gemma", - featurePrefix: "gemma", - featureTypes: ["fairway_dimensions"], - outputFormat: "application/json", - filter: equalTo("level_of_service", los) - }); + // loading the full WFS layer without bboxStrategy + var source = this.getVSourceByName("Fairway Dimensions LOS " + los) + var loader = function(extent, resolution, projection) { + var featureRequest = new WFS().writeGetFeature({ + srsName: "EPSG:3857", + featureNS: "gemma", + featurePrefix: "gemma", + featureTypes: ["fairway_dimensions"], + outputFormat: "application/json", + filter: equalTo("level_of_service", los) + }); - // NOTE: loading the full fairway_dimensions makes sure - // that all are available for the intersection with the profile - HTTP.post( - "/internal/wfs", - new XMLSerializer().serializeToString(featureRequest), - { - headers: { - "X-Gemma-Auth": localStorage.getItem("token"), - "Content-type": "text/xml; charset=UTF-8" + featureRequest["outputFormat"] = "application/json"; + // NOTE: loading the full fairway_dimensions makes sure + // that all are available for the intersection with the profile + HTTP.post( + "/internal/wfs", + new XMLSerializer().serializeToString(featureRequest), + { + headers: { + "X-Gemma-Auth": localStorage.getItem("token"), + "Content-type": "text/xml; charset=UTF-8" + } } - } - ).then(response => { - this.getVSourceByName("Fairway Dimensions LOS " + los).addFeatures( - new GeoJSON().readFeatures(JSON.stringify(response.data)) - ); - // would scale to the extend of all resulting features - // this.openLayersMap.getView().fit(vectorSrc.getExtent()); - }); + ).then(response => { + source.addFeatures( + new GeoJSON().readFeatures(JSON.stringify(response.data)) + ); + // would scale to the extend of all resulting features + // this.openLayersMap.getView().fit(vectorSrc.getExtent()); + }); + } + + layer = this.getLayerByName("Fairway Dimensions LOS " + los); + layer.data.getSource().setLoader(loader) }); // load following layers with bboxStrategy (using our request builder) diff -r b27edd1f2353 -r 826fc7309370 client/src/components/Zoom.vue --- a/client/src/components/Zoom.vue Mon Feb 11 16:16:35 2019 +0100 +++ b/client/src/components/Zoom.vue Mon Feb 11 16:19:52 2019 +0100 @@ -10,6 +10,12 @@ +