Mercurial > gemma
view client/src/map/store.js @ 663:db749c02127c
Client: slightly improve wfs loading for marks
* Remove stroke style that has not been used for point layers.
* Use a bbox filter to restrict loading roughly to the extend
of danube in Austria for the external distance marks.
* Add diagnosis information to console for both point layers.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Tue, 18 Sep 2018 09:03:55 +0200 |
parents | ef658c66cfca |
children | 89b497d0ee0f |
line wrap: on
line source
//import { HTTP } from "../lib/http"; 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, Fill, Text } from "ol/style.js"; import VectorSource from "ol/source/Vector.js"; const MapStore = { namespaced: true, state: { layers: [ { name: "Open Streetmap", data: new TileLayer({ source: new OSM() }), isVisible: true }, { name: "Inland ECDIS chart Danube", data: new TileLayer({ source: new TileWMS({ url: "https://demo.d4d-portal.info/wms", params: { LAYERS: "d4d", VERSION: "1.1.1", TILED: true } }) }), isVisible: true }, { name: "Fairways Dimensions", data: new VectorLayer({ source: new VectorSource(), 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 }, { name: "Waterway Area", data: new VectorLayer({ source: new VectorSource(), style: new Style({ stroke: new Stroke({ color: "rgba(180, 140, 40, 1.0)", width: 1.5 }) }) }), isVisible: true }, { name: "Waterway Axis", data: new VectorLayer({ source: new VectorSource(), style: new Style({ stroke: new Stroke({ color: "rgba(0, 0, 255, .5)", lineDash: [5, 5], width: 2 }) }) }), isVisible: true }, { name: "Distance marks", data: new VectorLayer({ source: new VectorSource() }), isVisible: false }, { name: "Distance marks, Axis", data: new VectorLayer({ source: new VectorSource() }), isVisible: true } ] }, getters: { layers: state => { return state.layers; } }, mutations: { toggleVisibility: (state, layer) => { state.layers[layer].isVisible = !state.layers[layer].isVisible; state.layers[layer].data.setVisible(state.layers[layer].isVisible); } } }; export default MapStore;