# HG changeset patch # User Bernhard Reiter # Date 1537194344 -7200 # Node ID ef658c66cfcad1656b6e27119a53f26bb2d1266b # Parent 288c496eca265d46cd9bb6db7b6e9db33cc4c075 schema: disable sfcgal * Comment out sfcgal extension because it is not available on Ubuntu LTS right now and the setup script will stop completely. diff -r 288c496eca26 -r ef658c66cfca client/src/map/Maplayer.vue --- 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); + }); } }; diff -r 288c496eca26 -r ef658c66cfca client/src/map/store.js --- 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 } ] }, diff -r 288c496eca26 -r ef658c66cfca schema/gemma.sql --- 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?