changeset 665:7345a249c9e1 octree

merged.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 18 Sep 2018 13:41:20 +0200
parents a3d722e1f593 (current diff) db749c02127c (diff)
children 7022a92e1314
files
diffstat 2 files changed, 9 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/map/Maplayer.vue	Tue Sep 18 13:41:04 2018 +0200
+++ b/client/src/map/Maplayer.vue	Tue Sep 18 13:41:20 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);
     });
   }
 };
--- a/client/src/map/store.js	Tue Sep 18 13:41:04 2018 +0200
+++ b/client/src/map/store.js	Tue Sep 18 13:41:20 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
       }