Mercurial > gemma
annotate client/src/components/map/layers.js @ 4644:486495590483
Merged stree-experiment into default to benefit from diff improvements.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sat, 12 Oct 2019 15:17:51 +0200 |
parents | 75d1126f7299 |
children | 5555b77b8c4e |
rev | line source |
---|---|
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 import TileWMS from "ol/source/TileWMS"; |
3031 | 2 import { |
3 Tile as TileLayer, | |
4 Vector as VectorLayer, | |
5 Image as ImageLayer | |
6 } from "ol/layer"; | |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 import { Icon, Stroke, Style } from "ol/style"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
8 import VectorSource from "ol/source/Vector"; |
3029
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3021
diff
changeset
|
9 import { ImageWMS as ImageSource } from "ol/source"; |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
10 import Point from "ol/geom/Point"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
11 import { bbox as bboxStrategy } from "ol/loadingstrategy"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
12 import { WFS, GeoJSON } from "ol/format"; |
3270
d7bc51fd50b0
client: map layers: integrated osm layer into main layer configuration file
Markus Kottlaender <markus@intevation.de>
parents:
3123
diff
changeset
|
13 import OSM from "ol/source/OSM"; |
4378
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
14 import { equalTo, and as andFilter } from "ol/format/filter"; |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
15 import { HTTP } from "@/lib/http"; |
4241
27434b0d4d96
Map: setting styles correctly for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4223
diff
changeset
|
16 import { styleFactory } from "./styles"; |
3271
b74e9768231d
client: map layers: added support for vuex store in layer configuration
Markus Kottlaender <markus@intevation.de>
parents:
3270
diff
changeset
|
17 import store from "@/store/index"; |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 |
4374
ad2bf9580696
importoverview: review of fairwaydimensions improved
Thomas Junk <thomas.junk@intevation.de>
parents:
4368
diff
changeset
|
19 export const buildVectorLoader = ( |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 featureRequestOptions, |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
21 vectorSource, |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 bboxStrategyDisabled, |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
23 featurePostProcessor |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 ) => { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 // build a function to be used for VectorSource.setLoader() |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 // make use of WFS().writeGetFeature to build the request |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 // and use our HTTP library to actually do it |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 // NOTE: the geometryName has to be given in featureRequestOptions if |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 // bboxStrategy (default) is used |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 featureRequestOptions.featureNS = "gemma"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 featureRequestOptions.featurePrefix = "gemma"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
32 featureRequestOptions.outputFormat = "application/json"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
33 return (extent, resolution, projection) => { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
34 if (!bboxStrategyDisabled) { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
35 featureRequestOptions.bbox = extent; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
36 } |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
37 featureRequestOptions.srsName = projection.getCode(); |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 HTTP.post( |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 "/internal/wfs", |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
40 new XMLSerializer().serializeToString( |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
41 new WFS().writeGetFeature(featureRequestOptions) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
42 ), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
43 { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
44 headers: { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
45 "X-Gemma-Auth": localStorage.getItem("token"), |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
46 "Content-type": "text/xml; charset=UTF-8" |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
47 } |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
48 } |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
49 ) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 .then(response => { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 const features = new GeoJSON().readFeatures( |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
52 JSON.stringify(response.data) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
53 ); |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
54 if (featurePostProcessor) { |
3507
a606d003730c
client: spuc12: implemented diagram for reference gauge of bottlenecks
Markus Kottlaender <markus@intevation.de>
parents:
3501
diff
changeset
|
55 features.map(f => featurePostProcessor(f, store, features)); |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 } |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
57 vectorSource.addFeatures(features); |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 .catch(() => { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
60 vectorSource.removeLoadedExtent(extent); |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
61 }); |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
62 }; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
63 }; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
64 |
3123
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
65 // SHARED LAYERS: |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
66 // DRAW- and CUTLAYER are shared across maps. E.g. you want to see the cross cut |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
67 // arrow on both maps when comparing surveys. So we don't need to initialize a |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
68 // new VectorLayer object for each map. Instead we use these two constants so |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
69 // that all maps use the same object. |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
70 const DRAWLAYER = new VectorLayer({ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
71 id: "DRAWTOOL", |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
72 label: "Draw Tool", |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
73 visible: true, |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
74 source: new VectorSource({ wrapX: false }), |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
75 style: function(feature) { |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
76 // adapted from OpenLayer's LineString Arrow Example |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
77 var geometry = feature.getGeometry(); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
78 var styles = [ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
79 // linestring |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
80 new Style({ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
81 stroke: new Stroke({ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
82 color: "#369aca", |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
83 width: 2 |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
84 }) |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
85 }) |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
86 ]; |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
87 |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
88 if (geometry.getType() === "LineString") { |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
89 geometry.forEachSegment(function(start, end) { |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
90 var dx = end[0] - start[0]; |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
91 var dy = end[1] - start[1]; |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
92 var rotation = Math.atan2(dy, dx); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
93 // arrows |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
94 styles.push( |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
95 new Style({ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
96 geometry: new Point(end), |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
97 image: new Icon({ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
98 // we need to make sure the image is loaded by Vue Loader |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
99 src: require("@/assets/linestring_arrow.png"), |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
100 // fiddling with the anchor's y value does not help to |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
101 // position the image more centered on the line ending, as the |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
102 // default line style seems to be slightly uncentered in the |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
103 // anti-aliasing, but the image is not placed with subpixel |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
104 // precision |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
105 anchor: [0.75, 0.5], |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
106 rotateWithView: true, |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
107 rotation: -rotation |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
108 }) |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
109 }) |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
110 ); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
111 }); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
112 } |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
113 return styles; |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
114 } |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
115 }); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
116 |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
117 const CUTLAYER = new VectorLayer({ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
118 id: "CUTTOOL", |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
119 label: "Cut Tool", |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
120 visible: true, |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
121 source: new VectorSource({ wrapX: false }), |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
122 style: function(feature) { |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
123 // adapted from OpenLayer's LineString Arrow Example |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
124 var geometry = feature.getGeometry(); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
125 var styles = [ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
126 // linestring |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
127 new Style({ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
128 stroke: new Stroke({ |
3643
f9032442620a
client: cross profiles: improved style of arrow on the map (added white border to have higher contrast)
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
129 color: "#FFFFFF", |
f9032442620a
client: cross profiles: improved style of arrow on the map (added white border to have higher contrast)
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
130 width: 5, |
f9032442620a
client: cross profiles: improved style of arrow on the map (added white border to have higher contrast)
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
131 lineDash: [7, 7] |
f9032442620a
client: cross profiles: improved style of arrow on the map (added white border to have higher contrast)
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
132 }) |
f9032442620a
client: cross profiles: improved style of arrow on the map (added white border to have higher contrast)
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
133 }), |
f9032442620a
client: cross profiles: improved style of arrow on the map (added white border to have higher contrast)
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
134 new Style({ |
f9032442620a
client: cross profiles: improved style of arrow on the map (added white border to have higher contrast)
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
135 stroke: new Stroke({ |
3123
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
136 color: "#333333", |
3643
f9032442620a
client: cross profiles: improved style of arrow on the map (added white border to have higher contrast)
Markus Kottlaender <markus@intevation.de>
parents:
3548
diff
changeset
|
137 width: 3, |
3123
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
138 lineDash: [7, 7] |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
139 }) |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
140 }) |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
141 ]; |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
142 |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
143 if (geometry.getType() === "LineString") { |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
144 geometry.forEachSegment(function(start, end) { |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
145 var dx = end[0] - start[0]; |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
146 var dy = end[1] - start[1]; |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
147 var rotation = Math.atan2(dy, dx); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
148 // arrows |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
149 styles.push( |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
150 new Style({ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
151 geometry: new Point(end), |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
152 image: new Icon({ |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
153 // we need to make sure the image is loaded by Vue Loader |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
154 src: require("@/assets/linestring_arrow_grey.png"), |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
155 // fiddling with the anchor's y value does not help to |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
156 // position the image more centered on the line ending, as the |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
157 // default line style seems to be slightly uncentered in the |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
158 // anti-aliasing, but the image is not placed with subpixel |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
159 // precision |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
160 anchor: [0.75, 0.5], |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
161 rotateWithView: true, |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
162 rotation: -rotation |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
163 }) |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
164 }) |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
165 ); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
166 }); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
167 } |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
168 return styles; |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
169 } |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
170 }); |
f0af359391a0
client: map layers: share certain layer objects across map
Markus Kottlaender <markus@intevation.de>
parents:
3102
diff
changeset
|
171 |
3685
8775bea8042a
client: layers: unset layer config on logout
Markus Kottlaender <markus@intevation.de>
parents:
3678
diff
changeset
|
172 let layerConfigs = {}; |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
173 |
3685
8775bea8042a
client: layers: unset layer config on logout
Markus Kottlaender <markus@intevation.de>
parents:
3678
diff
changeset
|
174 export const unsetLayerConfigs = function() { |
8775bea8042a
client: layers: unset layer config on logout
Markus Kottlaender <markus@intevation.de>
parents:
3678
diff
changeset
|
175 layerConfigs = {}; |
8775bea8042a
client: layers: unset layer config on logout
Markus Kottlaender <markus@intevation.de>
parents:
3678
diff
changeset
|
176 }; |
8775bea8042a
client: layers: unset layer config on logout
Markus Kottlaender <markus@intevation.de>
parents:
3678
diff
changeset
|
177 |
8775bea8042a
client: layers: unset layer config on logout
Markus Kottlaender <markus@intevation.de>
parents:
3678
diff
changeset
|
178 export const layerFactory = function(mapId) { |
3548
f3102fa16a69
client: data availability/accuracy: inject mapId into layer/styles factory to fix display issue with two maps
Markus Kottlaender <markus@intevation.de>
parents:
3547
diff
changeset
|
179 const styles = styleFactory(mapId); |
3547
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
180 // Shared feature source for layers: |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
181 // BOTTLENECKS, BOTTLENECKSTATUS and BOTTLENECKFAIRWAYAVAILABILITY |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
182 // Reduces bottlenecks_geoserver requests and number of stored feature objects. |
4336
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
183 const FDREVIEWLAYER = new VectorLayer({ |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
184 id: "FDREVIEWLAYER", |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
185 label: "Review", |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
186 visible: true, |
4368
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4336
diff
changeset
|
187 source: new VectorSource({ wrapX: false }), |
4336
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
188 style: styles.sections |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
189 }); |
3547
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
190 const bottlenecksSource = new VectorSource({ strategy: bboxStrategy }); |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
191 bottlenecksSource.setLoader( |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
192 buildVectorLoader( |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
193 { |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
194 featureTypes: ["bottlenecks_geoserver"], |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
195 geometryName: "area" |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
196 }, |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
197 bottlenecksSource, |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
198 false, |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
199 async (f, store) => { |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
200 if (f.get("fa_critical")) { |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
201 // look for fairway availability data in store. If present and |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
202 // not older than 15 min use it or fetch new data and store it. |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
203 let data = store.getters["fairwayavailability/fwLNWLOverviewData"](f); |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
204 if ( |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
205 data && |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
206 new Date().getTime() - data.createdAt.getTime() < 900000 |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
207 ) { |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
208 f.set("fa_data", data.data); |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
209 } else { |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
210 let date = new Date(); |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
211 data = await store.dispatch( |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
212 "fairwayavailability/loadAvailableFairwayDepthLNWLForMap", |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
213 { |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
214 feature: f, |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
215 from: date.toISOString().split("T")[0], |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
216 to: date.toISOString().split("T")[0], |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
217 frequency: "monthly", |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
218 LOS: 3 |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
219 } |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
220 ); |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
221 if (data) { |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
222 store.commit("fairwayavailability/addFwLNWLOverviewData", { |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
223 feature: f, |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
224 data, |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
225 createdAt: new Date() |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
226 }); |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
227 f.set("fa_data", data); |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
228 } |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
229 } |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
230 } |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
231 return f; |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
232 } |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
233 ) |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
234 ); |
47c61ea894b1
client: map layers: share same vector source object for layers that use the same geoserver view (bottlenecks_geoserver)
Markus Kottlaender <markus@intevation.de>
parents:
3507
diff
changeset
|
235 |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
236 // either use existing config or create new one |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
237 // important is only each map has its individual layer config |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
238 // but we don't want to create new layer objects each time a store value |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
239 // that is used here changes. |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
240 const config = layerConfigs.hasOwnProperty(mapId) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
241 ? layerConfigs[mapId] |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
242 : [ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
243 new TileLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
244 id: "OPENSTREETMAP", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
245 label: "Open Streetmap", |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
246 visible: true, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
247 source: new OSM() |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
248 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
249 new ImageLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
250 id: "INLANDECDIS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
251 label: "Inland ECDIS chart Danube", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
252 visible: true, |
4022
efe0904b1d45
Change of ECDIS no longer requires reload
Thomas Junk <thomas.junk@intevation.de>
parents:
3685
diff
changeset
|
253 source: null |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
254 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
255 new ImageLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
256 id: "WATERWAYAREA", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
257 label: "Waterway Area", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
258 maxResolution: 100, |
3030
3524bbc5067e
Use dingle tile WMS for ECDIS Layer and Max resolutions for some vector layers.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3029
diff
changeset
|
259 minResolution: 0, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
260 source: new ImageSource({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
261 url: window.location.origin + "/api/internal/wms", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
262 params: { LAYERS: "waterway_area", VERSION: "1.1.1", TILED: true }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
263 imageLoadFunction: function(tile, src) { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
264 HTTP.get(src, { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
265 headers: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
266 "X-Gemma-Auth": localStorage.getItem("token") |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
267 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
268 responseType: "blob" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
269 }).then(response => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
270 tile.getImage().src = URL.createObjectURL(response.data); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
271 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
272 } // TODO tile.setState(TileState.ERROR); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
273 }) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
274 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
275 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
276 const source = new VectorSource({ strategy: bboxStrategy }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
277 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
278 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
279 { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
280 featureTypes: ["stretches_geoserver"], |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
281 geometryName: "area" |
3047
e0b77d7463e7
Changed Waterway axis and area layer to WMS.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3031
diff
changeset
|
282 }, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
283 source, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
284 true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
285 (f, store) => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
286 if (f.getId() === store.state.imports.selectedStretchId) { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
287 f.set("highlighted", true); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
288 } |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
289 return f; |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
290 } |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
291 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
292 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
293 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
294 id: "STRETCHES", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
295 label: "Stretches", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
296 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
297 style: styles.stretches, |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
298 source |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
299 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
300 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
301 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
302 const source = new VectorSource({ strategy: bboxStrategy }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
303 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
304 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
305 { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
306 featureTypes: ["sections_geoserver"], |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
307 geometryName: "area" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
308 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
309 source, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
310 true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
311 (f, store) => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
312 if (f.getId() === store.state.imports.selectedSectionId) { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
313 f.set("highlighted", true); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
314 } |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
315 return f; |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
316 } |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
317 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
318 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
319 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
320 id: "SECTIONS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
321 label: "Sections", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
322 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
323 style: styles.sections, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
324 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
325 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
326 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
327 (function() { |
4600
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
328 return new VectorLayer({ |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
329 id: "BOTTLENECKS", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
330 label: "Bottlenecks", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
331 visible: true, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
332 style: styles.bottleneck, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
333 source: bottlenecksSource |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
334 }); |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
335 })(), |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
336 new TileLayer({ |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
337 id: "BOTTLENECKISOLINE", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
338 label: "Bottleneck morphology", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
339 visible: false, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
340 source: new TileWMS({ |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
341 preload: 0, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
342 projection: "EPSG:3857", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
343 url: window.location.origin + "/api/internal/wms", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
344 params: { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
345 LAYERS: "sounding_results_areas_geoserver", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
346 VERSION: "1.1.1", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
347 TILED: true |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
348 }, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
349 tileLoadFunction: function(tile, src) { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
350 HTTP.get(src, { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
351 headers: { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
352 "X-Gemma-Auth": localStorage.getItem("token") |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
353 }, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
354 responseType: "blob" |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
355 }).then(response => { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
356 tile.getImage().src = URL.createObjectURL(response.data); |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
357 }); |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
358 } // TODO tile.setState(TileState.ERROR); |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
359 }) |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
360 }), |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
361 new TileLayer({ |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
362 id: "DIFFERENCES", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
363 label: "Bottleneck Differences", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
364 visible: false, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
365 source: new TileWMS({ |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
366 preload: 0, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
367 projection: "EPSG:3857", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
368 url: window.location.origin + "/api/internal/wms", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
369 params: { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
370 LAYERS: "sounding_differences", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
371 VERSION: "1.1.1", |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
372 TILED: true, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
373 CQL_FILTER: "id=" + store.state.fairwayprofile.currentDifference |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
374 }, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
375 tileLoadFunction: function(tile, src) { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
376 HTTP.get(src, { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
377 headers: { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
378 "X-Gemma-Auth": localStorage.getItem("token") |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
379 }, |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
380 responseType: "blob" |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
381 }).then(response => { |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
382 tile.getImage().src = URL.createObjectURL(response.data); |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
383 }); |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
384 } // TODO tile.setState(TileState.ERROR); |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
385 }) |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
386 }), |
75d1126f7299
Reordered layers so that features are not covered by new filled morphology.
Sascha Wilde <wilde@intevation.de>
parents:
4580
diff
changeset
|
387 (function() { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
388 const source = new VectorSource({ strategy: bboxStrategy }); |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
389 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
390 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
391 { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
392 geometryName: "area", |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
393 featureTypes: ["fairway_dimensions"], |
4378
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
394 filter: andFilter( |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
395 equalTo("level_of_service", 1), |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
396 equalTo("staging_done", true) |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
397 ) |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
398 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
399 source, |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
400 false |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
401 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
402 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
403 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
404 id: "FAIRWAYDIMENSIONSLOS1", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
405 label: "LOS 1 Fairway Dimensions", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
406 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
407 style: styles.fwd1, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
408 maxResolution: 80, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
409 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
410 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
411 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
412 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
413 (function() { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
414 const source = new VectorSource({ strategy: bboxStrategy }); |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
415 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
416 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
417 { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
418 geometryName: "area", |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
419 featureTypes: ["fairway_dimensions"], |
4378
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
420 filter: andFilter( |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
421 equalTo("level_of_service", 2), |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
422 equalTo("staging_done", true) |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
423 ) |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
424 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
425 source, |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
426 false |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
427 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
428 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
429 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
430 id: "FAIRWAYDIMENSIONSLOS2", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
431 label: "LOS 2 Fairway Dimensions", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
432 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
433 style: styles.fwd2, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
434 maxResolution: 80, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
435 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
436 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
437 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
438 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
439 (function() { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
440 const source = new VectorSource({ strategy: bboxStrategy }); |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
441 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
442 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
443 { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
444 geometryName: "area", |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
445 featureTypes: ["fairway_dimensions"], |
4378
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
446 filter: andFilter( |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
447 equalTo("level_of_service", 3), |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
448 equalTo("staging_done", true) |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
449 ) |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
450 }, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
451 source, |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
452 false |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
453 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
454 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
455 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
456 id: "FAIRWAYDIMENSIONSLOS3", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
457 label: "LOS 3 Fairway Dimensions", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
458 visible: true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
459 style: styles.fwd3, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
460 maxResolution: 80, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
461 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
462 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
463 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
464 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
465 new ImageLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
466 id: "WATERWAYAXIS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
467 label: "Waterway Axis", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
468 source: new ImageSource({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
469 url: window.location.origin + "/api/internal/wms", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
470 params: { LAYERS: "waterway_axis", VERSION: "1.1.1", TILED: true }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
471 imageLoadFunction: function(tile, src) { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
472 HTTP.get(src, { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
473 headers: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
474 "X-Gemma-Auth": localStorage.getItem("token") |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
475 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
476 responseType: "blob" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
477 }).then(response => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
478 tile.getImage().src = URL.createObjectURL(response.data); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
479 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
480 } // TODO tile.setState(TileState.ERROR); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
481 }) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
482 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
483 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
484 const source = new VectorSource({ strategy: bboxStrategy }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
485 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
486 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
487 { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
488 featureTypes: ["waterway_profiles"], |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
489 geometryName: "geom" |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
490 }, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
491 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
492 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
493 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
494 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
495 id: "WATERWAYPROFILES", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
496 label: "Waterway Profiles", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
497 visible: true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
498 style: new Style({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
499 stroke: new Stroke({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
500 color: "rgba(0, 0, 255, .5)", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
501 lineDash: [5, 5], |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
502 width: 2 |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
503 }) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
504 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
505 maxResolution: 2.5, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
506 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
507 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
508 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
509 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
510 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
511 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
512 id: "BOTTLENECKSTATUS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
513 label: "Critical Bottlenecks", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
514 forLegendStyle: { point: true, resolution: 16 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
515 visible: true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
516 zIndex: 1, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
517 style: styles.bottleneckStatus, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
518 source: bottlenecksSource |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
519 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
520 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
521 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
522 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
523 id: "BOTTLENECKFAIRWAYAVAILABILITY", |
4223
a76a6b26e327
client: improve layer label
Bernhard Reiter <bernhard@intevation.de>
parents:
4022
diff
changeset
|
524 label: "Bottleneck Fairway Availability", |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
525 forLegendStyle: { point: true, resolution: 16 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
526 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
527 zIndex: 1, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
528 style: styles.bottleneckFairwayAvailability, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
529 source: bottlenecksSource |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
530 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
531 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
532 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
533 const source = new VectorSource({ strategy: bboxStrategy }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
534 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
535 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
536 { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
537 featureTypes: [ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
538 "bottlenecks_geoserver", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
539 "gauges_geoserver", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
540 "stretches_geoserver", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
541 "sections_geoserver" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
542 ] |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
543 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
544 source, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
545 true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
546 // since we don't use bbox strategy, features will contain all features and we can use it |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
547 // to find reference gauges for bottlenecks, yeah! |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
548 async (f, store, features) => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
549 // attach reference gauge to bottleneck |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
550 if (f.getId().indexOf("bottlenecks") > -1) { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
551 f.set( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
552 "gauge_obj", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
553 features.find(feat => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
554 return ( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
555 feat.getId().indexOf("gauges") > -1 && |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
556 feat.get("objname") === f.get("gauge_objname") |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
557 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
558 }) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
559 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
560 } |
3507
a606d003730c
client: spuc12: implemented diagram for reference gauge of bottlenecks
Markus Kottlaender <markus@intevation.de>
parents:
3501
diff
changeset
|
561 |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
562 // attach nsc data to gauge |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
563 if (f.getId().indexOf("gauges") > -1) { |
4292
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
564 store |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
565 .dispatch( |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
566 "gauges/getNashSutcliffeForISRS", |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
567 f.get("isrs_code") |
4292
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
568 ) |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
569 .then(response => { |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
570 f.set("nsc_data", response); |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
571 }); |
3501
c5c7cc24fe72
client: spuc12: implemented nash sutcliffe for forcast vs reality accuracy indicator
Markus Kottlaender <markus@intevation.de>
parents:
3457
diff
changeset
|
572 } |
c5c7cc24fe72
client: spuc12: implemented nash sutcliffe for forcast vs reality accuracy indicator
Markus Kottlaender <markus@intevation.de>
parents:
3457
diff
changeset
|
573 } |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
574 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
575 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
576 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
577 id: "DATAAVAILABILITY", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
578 label: "Data Availability/Accuracy", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
579 forLegendStyle: { point: true, resolution: 16 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
580 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
581 zIndex: 1, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
582 style: styles.dataAvailability, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
583 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
584 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
585 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
586 new ImageLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
587 id: "DISTANCEMARKS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
588 label: "Distance Marks", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
589 maxResolution: 10, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
590 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
591 source: new ImageSource({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
592 url: window.location.origin + "/api/internal/wms", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
593 params: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
594 LAYERS: "distance_marks_ashore_geoserver", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
595 VERSION: "1.1.1", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
596 TILED: true |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
597 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
598 imageLoadFunction: function(tile, src) { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
599 HTTP.get(src, { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
600 headers: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
601 "X-Gemma-Auth": localStorage.getItem("token") |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
602 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
603 responseType: "blob" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
604 }).then(response => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
605 tile.getImage().src = URL.createObjectURL(response.data); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
606 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
607 } // TODO tile.setState(TileState.ERROR); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
608 }) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
609 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
610 new ImageLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
611 id: "DISTANCEMARKSAXIS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
612 label: "Distance Marks, Axis", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
613 source: new ImageSource({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
614 url: window.location.origin + "/api/internal/wms", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
615 params: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
616 LAYERS: "distance_marks_geoserver", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
617 VERSION: "1.1.1", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
618 TILED: true |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
619 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
620 imageLoadFunction: function(tile, src) { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
621 HTTP.get(src, { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
622 headers: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
623 "X-Gemma-Auth": localStorage.getItem("token") |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
624 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
625 responseType: "blob" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
626 }).then(response => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
627 tile.getImage().src = URL.createObjectURL(response.data); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
628 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
629 } // TODO tile.setState(TileState.ERROR); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
630 }) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
631 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
632 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
633 const source = new VectorSource({ strategy: bboxStrategy }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
634 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
635 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
636 { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
637 featureTypes: ["gauges_geoserver"], |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
638 geometryName: "geom" |
3081
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3075
diff
changeset
|
639 }, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
640 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
641 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
642 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
643 return new VectorLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
644 id: "GAUGES", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
645 label: "Gauges", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
646 forLegendStyle: { point: true, resolution: 8 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
647 visible: true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
648 style: styles.gauge, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
649 maxResolution: 100, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
650 minResolution: 0, |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
651 source |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
652 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
653 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
654 DRAWLAYER, |
4336
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
655 CUTLAYER, |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
656 FDREVIEWLAYER |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
657 ]; |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
658 |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
659 layerConfigs[mapId] = config; |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
660 |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
661 return { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
662 get(id) { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
663 return config.find(l => l.get("id") === id); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
664 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
665 config |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
666 }; |
3685
8775bea8042a
client: layers: unset layer config on logout
Markus Kottlaender <markus@intevation.de>
parents:
3678
diff
changeset
|
667 }; |