Mercurial > gemma
comparison client/src/map/Maplayer.vue @ 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 | 6987b5c926b8 |
children | b17a4482d07d |
comparison
equal
deleted
inserted
replaced
619:6af5f8fee3a3 | 620:ef00684e021f |
---|---|
100 var vectorSrc = that.layers[2].data.getSource(); | 100 var vectorSrc = that.layers[2].data.getSource(); |
101 vectorSrc.addFeatures(features); | 101 vectorSrc.addFeatures(features); |
102 // would scale to the extend of all resulting features | 102 // would scale to the extend of all resulting features |
103 // that.openLayersMap.getView().fit(vectorSrc.getExtent()); | 103 // that.openLayersMap.getView().fit(vectorSrc.getExtent()); |
104 }); | 104 }); |
105 | |
106 // FIXME this is hardwired for now to try for an external point layer | |
107 var featureRequest2 = new WFS().writeGetFeature({ | |
108 // srsName: "urn:ogc:def:crs:EPSG::4326", | |
109 // srsName: "EPSG:3857", | |
110 // featureNS: "gemma", | |
111 featurePrefix: "ws-wamos", | |
112 featureTypes: ["hydro_boyspp"], | |
113 outputFormat: "application/json" | |
114 }); | |
115 | |
116 HTTP.post( | |
117 "/external/d4d", | |
118 new XMLSerializer().serializeToString(featureRequest2), | |
119 { | |
120 headers: { | |
121 "X-Gemma-Auth": localStorage.getItem("token"), | |
122 "Content-type": "text/xml; charset=UTF-8" | |
123 } | |
124 } | |
125 ).then(function(response) { | |
126 var features = new GeoJSON().readFeatures(JSON.stringify(response.data)); | |
127 var vectorSrc = that.layers[3].data.getSource(); | |
128 vectorSrc.addFeatures(features); | |
129 // would scale to the extend of all resulting features | |
130 // that.openLayersMap.getView().fit(vectorSrc.getExtent()); | |
131 }); | |
105 } | 132 } |
106 }; | 133 }; |
107 </script> | 134 </script> |