changeset 659:ef658c66cfca

schema: disable sfcgal * Comment out sfcgal extension because it is not available on Ubuntu LTS right now and the setup script will stop completely.
author Bernhard Reiter <bernhard@intevation.de>
date Mon, 17 Sep 2018 16:25:44 +0200
parents 288c496eca26
children 79db27e3a999
files client/src/map/Maplayer.vue client/src/map/store.js schema/gemma.sql
diffstat 3 files changed, 61 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/map/Maplayer.vue	Fri Sep 14 18:02:53 2018 +0200
+++ b/client/src/map/Maplayer.vue	Mon Sep 17 16:25:44 2018 +0200
@@ -199,6 +199,30 @@
       this.layers[5].data.setVisible(this.layers[5].isVisible);
       vectorSrc.addFeatures(features);
     });
+
+    // FIXME this is hardwired for now
+    var featureRequest6 = new WFS().writeGetFeature({
+      srsName: "EPSG:3857",
+      featureNS: "gemma",
+      featurePrefix: "gemma",
+      featureTypes: ["distance_marks"],
+      outputFormat: "application/json"
+    });
+
+    HTTP.post(
+      "/internal/wfs",
+      new XMLSerializer().serializeToString(featureRequest6),
+      {
+        headers: {
+          "X-Gemma-Auth": localStorage.getItem("token"),
+          "Content-type": "text/xml; charset=UTF-8"
+        }
+      }
+    ).then(response => {
+      var features = new GeoJSON().readFeatures(JSON.stringify(response.data));
+      var vectorSrc = this.layers[6].data.getSource();
+      vectorSrc.addFeatures(features);
+    });
   }
 };
 </script>
--- a/client/src/map/store.js	Fri Sep 14 18:02:53 2018 +0200
+++ b/client/src/map/store.js	Mon Sep 17 16:25:44 2018 +0200
@@ -3,7 +3,7 @@
 import TileWMS from "ol/source/TileWMS.js";
 import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer.js";
 import OSM from "ol/source/OSM";
-import { Stroke, Style } from "ol/style.js";
+import { Stroke, Style, Fill, Text } from "ol/style.js";
 import VectorSource from "ol/source/Vector.js";
 
 const MapStore = {
@@ -31,12 +31,27 @@
         name: "Fairways Dimensions",
         data: new VectorLayer({
           source: new VectorSource(),
-          style: new Style({
-            stroke: new Stroke({
-              color: "rgba(0, 0, 255, 1.0)",
-              width: 2
-            })
-          })
+          style: function(feature) {
+            return [
+              new Style({
+                stroke: new Stroke({
+                  color: "rgba(0, 0, 255, 1.0)",
+                  width: 2
+                })
+              }),
+              new Style({
+                text: new Text({
+                  font: 'bold 12px "Open Sans", "sans-serif"',
+                  placement: "line",
+                  fill: new Fill({
+                    color: "black"
+                  }),
+                  text: "LOS: " + feature.get("level_of_service").toString()
+                  //, zIndex: 10
+                })
+              })
+            ];
+          }
         }),
         isVisible: true
       },
@@ -80,6 +95,19 @@
           */
         }),
         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
+            })
+          })
+        }),
+        isVisible: true
       }
     ]
   },
--- a/schema/gemma.sql	Fri Sep 14 18:02:53 2018 +0200
+++ b/schema/gemma.sql	Mon Sep 17 16:25:44 2018 +0200
@@ -6,7 +6,8 @@
 CREATE EXTENSION postgis;
 
 -- Needed for 3D processing e.g. for cross section profiles
-CREATE EXTENSION postgis_sfcgal;
+-- FIXME disabled for now, because not available on Ubuntu/Debian
+--CREATE EXTENSION postgis_sfcgal;
 
 -- TODO: will there ever be UPDATEs or can we drop that function due to
 -- historicisation?