# HG changeset patch # User Bernhard Reiter # Date 1537254235 -7200 # Node ID db749c02127c150051ec656d37ae1af108646cd3 # Parent 79db27e3a999dac5b7911ab08405b2457d107b04 Client: slightly improve wfs loading for marks * Remove stroke style that has not been used for point layers. * Use a bbox filter to restrict loading roughly to the extend of danube in Austria for the external distance marks. * Add diagnosis information to console for both point layers. diff -r 79db27e3a999 -r db749c02127c client/src/map/Maplayer.vue --- a/client/src/map/Maplayer.vue Mon Sep 17 18:02:17 2018 +0200 +++ b/client/src/map/Maplayer.vue Tue Sep 18 09:03:55 2018 +0200 @@ -16,8 +16,7 @@ import { HTTP } from "../application/lib/http"; import "ol/ol.css"; import { Map, View } from "ol"; -// needed for vector filter example -// import { greaterThan as greaterThanFilter } from "ol/format/filter.js"; +import { bbox as bboxFilter } from "ol/format/filter.js"; import { WFS, GeoJSON } from "ol/format.js"; import { mapGetters } from "vuex"; import Draw from "ol/interaction/Draw.js"; @@ -112,8 +111,6 @@ featurePrefix: "gemma", featureTypes: ["fairway_dimensions"], outputFormat: "application/json" - // example for a filter - //filter: greaterThanFilter("level_of_service", 0) }); HTTP.post( @@ -181,7 +178,9 @@ var featureRequest5 = new WFS().writeGetFeature({ featurePrefix: "ws-wamos", featureTypes: ["ienc_dismar"], - outputFormat: "application/json" + outputFormat: "application/json", + /* restrict loading approximately to extend of danube in Austria */ + filter: bboxFilter("geom", [13.3, 48.0, 17.1, 48.6], "EPSG:4326") }); HTTP.post( @@ -198,11 +197,12 @@ var vectorSrc = this.layers[5].data.getSource(); this.layers[5].data.setVisible(this.layers[5].isVisible); vectorSrc.addFeatures(features); + console.log("loaded ", features, "for", vectorSrc); }); // FIXME this is hardwired for now var featureRequest6 = new WFS().writeGetFeature({ - srsName: "EPSG:3857", + srsName: "EPSG:4326", featureNS: "gemma", featurePrefix: "gemma", featureTypes: ["distance_marks"], @@ -222,6 +222,7 @@ var features = new GeoJSON().readFeatures(JSON.stringify(response.data)); var vectorSrc = this.layers[6].data.getSource(); vectorSrc.addFeatures(features); + console.log("loaded ", features, "for", vectorSrc); }); } }; diff -r 79db27e3a999 -r db749c02127c client/src/map/store.js --- a/client/src/map/store.js Mon Sep 17 18:02:17 2018 +0200 +++ b/client/src/map/store.js Tue Sep 18 09:03:55 2018 +0200 @@ -85,27 +85,14 @@ { name: "Distance marks", data: new VectorLayer({ - source: new VectorSource() /*, - style: new Style({ - stroke: new Stroke({ - color: "rgba(0, 0, 255, 1.0)", - width: 2 - }) - }) - */ + source: new VectorSource() }), isVisible: false }, { name: "Distance marks, Axis", data: new VectorLayer({ - source: new VectorSource(), - style: new Style({ - stroke: new Stroke({ - color: "rgba(0, 255, 255, 1.0)", - width: 3 - }) - }) + source: new VectorSource() }), isVisible: true }