Mercurial > gemma
annotate client/src/components/map/layers.js @ 4533:3998a9ab69c6 iso-areas
Find out which triangles are fully inside classes.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 25 Sep 2019 13:04:08 +0200 |
parents | 69166db6ba8a |
children | 9887061df57b |
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() { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
328 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
|
329 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
330 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
331 { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
332 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
|
333 featureTypes: ["fairway_dimensions"], |
4378
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
334 filter: andFilter( |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
335 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
|
336 equalTo("staging_done", true) |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
337 ) |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
338 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
339 source, |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
340 false |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
341 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
342 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
343 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
|
344 id: "FAIRWAYDIMENSIONSLOS1", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
345 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
|
346 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
347 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
|
348 maxResolution: 80, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
349 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
350 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
351 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
352 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
353 (function() { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
354 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
|
355 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
356 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
357 { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
358 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
|
359 featureTypes: ["fairway_dimensions"], |
4378
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
360 filter: andFilter( |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
361 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
|
362 equalTo("staging_done", true) |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
363 ) |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
364 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
365 source, |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
366 false |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
367 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
368 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
369 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
|
370 id: "FAIRWAYDIMENSIONSLOS2", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
371 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
|
372 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
373 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
|
374 maxResolution: 80, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
375 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
376 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
377 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
378 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
379 (function() { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
380 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
|
381 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
382 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
383 { |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
384 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
|
385 featureTypes: ["fairway_dimensions"], |
4378
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
386 filter: andFilter( |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
387 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
|
388 equalTo("staging_done", true) |
09406e3b052c
layers: only load fairwaydimensions with staging_done on map
Thomas Junk <thomas.junk@intevation.de>
parents:
4374
diff
changeset
|
389 ) |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
390 }, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
391 source, |
4261
ac99e13e9ca9
layers: BBox strategy for fairwaydimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4241
diff
changeset
|
392 false |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
393 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
394 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
395 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
|
396 id: "FAIRWAYDIMENSIONSLOS3", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
397 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
|
398 visible: true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
399 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
|
400 maxResolution: 80, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
401 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
402 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
403 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
404 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
405 new ImageLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
406 id: "WATERWAYAXIS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
407 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
|
408 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
|
409 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
|
410 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
|
411 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
|
412 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
|
413 headers: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
414 "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
|
415 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
416 responseType: "blob" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
417 }).then(response => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
418 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
|
419 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
420 } // 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
|
421 }) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
422 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
423 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
424 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
|
425 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
426 buildVectorLoader( |
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 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
|
429 geometryName: "geom" |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
430 }, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
431 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
432 ) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
433 ); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
434 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
|
435 id: "WATERWAYPROFILES", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
436 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
|
437 visible: true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
438 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
|
439 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
|
440 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
|
441 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
|
442 width: 2 |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
443 }) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
444 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
445 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
|
446 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
447 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
448 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
449 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
450 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
451 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
|
452 id: "BOTTLENECKS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
453 label: "Bottlenecks", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
454 visible: true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
455 style: styles.bottleneck, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
456 source: bottlenecksSource |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
457 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
458 })(), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
459 new TileLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
460 id: "BOTTLENECKISOLINE", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
461 label: "Bottleneck isolines", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
462 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
463 source: new TileWMS({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
464 preload: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
465 projection: "EPSG:3857", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
466 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
|
467 params: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
468 LAYERS: "sounding_results_contour_lines_geoserver", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
469 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
|
470 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 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
472 tileLoadFunction: 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
|
473 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
|
474 headers: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
475 "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
|
476 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
477 responseType: "blob" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
478 }).then(response => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
479 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
|
480 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
481 } // 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
|
482 }) |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
483 }), |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
484 new TileLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
485 id: "DIFFERENCES", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
486 label: "Bottleneck Differences", |
3335
59db0b5921c5
client: added layer for fairway availability diagrams with demo diagrams
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
487 visible: false, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
488 source: new TileWMS({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
489 preload: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
490 projection: "EPSG:3857", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
491 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
|
492 params: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
493 LAYERS: "sounding_differences", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
494 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
|
495 TILED: true |
3434
9fba1be118e7
client: data accuracy: Show diagrams for gauges, bottlenecks and stretches on map.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3433
diff
changeset
|
496 }, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
497 tileLoadFunction: 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
|
498 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
|
499 headers: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
500 "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
|
501 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
502 responseType: "blob" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
503 }).then(response => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
504 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
|
505 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
506 } // 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
|
507 }) |
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 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
510 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
|
511 id: "BOTTLENECKSTATUS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
512 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
|
513 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
|
514 visible: true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
515 zIndex: 1, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
516 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
|
517 source: bottlenecksSource |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
518 }); |
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 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
521 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
|
522 id: "BOTTLENECKFAIRWAYAVAILABILITY", |
4223
a76a6b26e327
client: improve layer label
Bernhard Reiter <bernhard@intevation.de>
parents:
4022
diff
changeset
|
523 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
|
524 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
|
525 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
526 zIndex: 1, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
527 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
|
528 source: bottlenecksSource |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
529 }); |
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 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
532 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
|
533 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
534 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
535 { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
536 featureTypes: [ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
537 "bottlenecks_geoserver", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
538 "gauges_geoserver", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
539 "stretches_geoserver", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
540 "sections_geoserver" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
541 ] |
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 source, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
544 true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
545 // 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
|
546 // 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
|
547 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
|
548 // 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
|
549 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
|
550 f.set( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
551 "gauge_obj", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
552 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
|
553 return ( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
554 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
|
555 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
|
556 ); |
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 } |
3507
a606d003730c
client: spuc12: implemented diagram for reference gauge of bottlenecks
Markus Kottlaender <markus@intevation.de>
parents:
3501
diff
changeset
|
560 |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
561 // 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
|
562 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
|
563 store |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
564 .dispatch( |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
565 "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
|
566 f.get("isrs_code") |
4292
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
567 ) |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
568 .then(response => { |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
569 f.set("nsc_data", response); |
18a34d9b289c
data availability layer: loader uses new cache
Thomas Junk <thomas.junk@intevation.de>
parents:
4261
diff
changeset
|
570 }); |
3501
c5c7cc24fe72
client: spuc12: implemented nash sutcliffe for forcast vs reality accuracy indicator
Markus Kottlaender <markus@intevation.de>
parents:
3457
diff
changeset
|
571 } |
c5c7cc24fe72
client: spuc12: implemented nash sutcliffe for forcast vs reality accuracy indicator
Markus Kottlaender <markus@intevation.de>
parents:
3457
diff
changeset
|
572 } |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
573 ) |
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 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
|
576 id: "DATAAVAILABILITY", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
577 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
|
578 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
|
579 visible: false, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
580 zIndex: 1, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
581 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
|
582 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
583 }); |
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 new ImageLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
586 id: "DISTANCEMARKS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
587 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
|
588 maxResolution: 10, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
589 minResolution: 0, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
590 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
|
591 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
|
592 params: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
593 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
|
594 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
|
595 TILED: true |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
596 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
597 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
|
598 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
|
599 headers: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
600 "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
|
601 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
602 responseType: "blob" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
603 }).then(response => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
604 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
|
605 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
606 } // 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
|
607 }) |
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 new ImageLayer({ |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
610 id: "DISTANCEMARKSAXIS", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
611 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
|
612 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
|
613 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
|
614 params: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
615 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
|
616 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
|
617 TILED: true |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
618 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
619 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
|
620 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
|
621 headers: { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
622 "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
|
623 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
624 responseType: "blob" |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
625 }).then(response => { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
626 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
|
627 }); |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
628 } // 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
|
629 }) |
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 (function() { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
632 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
|
633 source.setLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
634 buildVectorLoader( |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
635 { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
636 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
|
637 geometryName: "geom" |
3081
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3075
diff
changeset
|
638 }, |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
639 source |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
640 ) |
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 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
|
643 id: "GAUGES", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
644 label: "Gauges", |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
645 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
|
646 visible: true, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
647 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
|
648 maxResolution: 100, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
649 minResolution: 0, |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
650 source |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
651 }); |
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 DRAWLAYER, |
4336
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
654 CUTLAYER, |
45307cf4931a
Review of fairway dimensions
Thomas Junk <thomas.junk@intevation.de>
parents:
4292
diff
changeset
|
655 FDREVIEWLAYER |
3678
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
656 ]; |
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 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
|
659 |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
660 return { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
661 get(id) { |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
662 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
|
663 }, |
8f58851927c0
client: make layer factory only return new layer config for individual maps
Markus Kottlaender <markus@intevation.de>
parents:
3649
diff
changeset
|
664 config |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
665 }; |
3685
8775bea8042a
client: layers: unset layer config on logout
Markus Kottlaender <markus@intevation.de>
parents:
3678
diff
changeset
|
666 }; |