Mercurial > gemma
changeset 620:ef00684e021f
client: add showing special buoys
* Add hardwired a point layer with an external wfs configured
like in the standard readme showing the special/general buoys.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Tue, 11 Sep 2018 12:38:34 +0200 |
parents | 6af5f8fee3a3 |
children | b17a4482d07d |
files | client/src/map/Maplayer.vue client/src/map/store.js |
diffstat | 2 files changed, 41 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/map/Maplayer.vue Tue Sep 11 11:40:31 2018 +0200 +++ b/client/src/map/Maplayer.vue Tue Sep 11 12:38:34 2018 +0200 @@ -102,6 +102,33 @@ // would scale to the extend of all resulting features // that.openLayersMap.getView().fit(vectorSrc.getExtent()); }); + + // FIXME this is hardwired for now to try for an external point layer + var featureRequest2 = new WFS().writeGetFeature({ + // srsName: "urn:ogc:def:crs:EPSG::4326", + // srsName: "EPSG:3857", + // featureNS: "gemma", + featurePrefix: "ws-wamos", + featureTypes: ["hydro_boyspp"], + outputFormat: "application/json" + }); + + HTTP.post( + "/external/d4d", + new XMLSerializer().serializeToString(featureRequest2), + { + headers: { + "X-Gemma-Auth": localStorage.getItem("token"), + "Content-type": "text/xml; charset=UTF-8" + } + } + ).then(function(response) { + var features = new GeoJSON().readFeatures(JSON.stringify(response.data)); + var vectorSrc = that.layers[3].data.getSource(); + vectorSrc.addFeatures(features); + // would scale to the extend of all resulting features + // that.openLayersMap.getView().fit(vectorSrc.getExtent()); + }); } }; </script>
--- a/client/src/map/store.js Tue Sep 11 11:40:31 2018 +0200 +++ b/client/src/map/store.js Tue Sep 11 12:38:34 2018 +0200 @@ -39,6 +39,20 @@ }) }), isVisible: true + }, + { + name: "Buoy, special purpose/general", + data: new VectorLayer({ + source: new VectorSource() /*, + style: new Style({ + stroke: new Stroke({ + color: "rgba(0, 0, 255, 1.0)", + width: 2 + }) + }) + */ + }), + isVisible: true } ] },