Mercurial > gemma
annotate client/src/store/map.js @ 2823:b150e5b37afe
Import queue: As it is important to keep the in-memory and the persistent model in sync try harder to store the final state change if it fails.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 27 Mar 2019 12:12:12 +0100 |
parents | b79f5c5404c2 |
children | b6886706b325 |
rev | line source |
---|---|
1362
ca33ad696594
remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1361
diff
changeset
|
1 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
1019
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
975
diff
changeset
|
2 * without warranty, see README.md and license for details. |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1313
diff
changeset
|
3 * |
1019
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
975
diff
changeset
|
4 * SPDX-License-Identifier: AGPL-3.0-or-later |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
975
diff
changeset
|
5 * License-Filename: LICENSES/AGPL-3.0.txt |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1313
diff
changeset
|
6 * |
1927
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
7 * Copyright (C) 2018, 2019 by via donau |
1019
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
975
diff
changeset
|
8 * – Österreichische Wasserstraßen-Gesellschaft mbH |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
975
diff
changeset
|
9 * Software engineering by Intevation GmbH |
1361
ea3a89a1813a
remove trailing whitespace, add headers for Makefile, add the missed authors
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1313
diff
changeset
|
10 * |
1019
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
975
diff
changeset
|
11 * Author(s): |
1927
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
12 * * Bernhard Reiter <bernhard.reiter@intevation.de> |
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
13 * * Markus Kottländer <markus@intevation.de> |
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
14 * * Thomas Junk <thomas.junk@intevation.de> |
1019
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
975
diff
changeset
|
15 */ |
ca628dce90dd
Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents:
975
diff
changeset
|
16 |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 //import { HTTP } from "../lib/http"; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
18 |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
19 import TileWMS from "ol/source/TileWMS.js"; |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
20 import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer.js"; |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
21 import OSM from "ol/source/OSM"; |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
22 import Draw from "ol/interaction/Draw.js"; |
2568
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
23 import { Icon, Stroke, Style, Fill, Text, Circle } from "ol/style.js"; |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
24 import VectorSource from "ol/source/Vector.js"; |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
25 import Point from "ol/geom/Point.js"; |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
26 import { bbox as bboxStrategy } from "ol/loadingstrategy"; |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
1247
diff
changeset
|
27 import { HTTP } from "../lib/http"; |
1158
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
28 import { fromLonLat } from "ol/proj"; |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
29 import { getLength, getArea } from "ol/sphere.js"; |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
30 import { unByKey } from "ol/Observable"; |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
31 import { getCenter } from "ol/extent"; |
2132
7a2eedc182f7
staging: zoomable stretches. zoomToExtent etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2125
diff
changeset
|
32 import { transformExtent } from "ol/proj.js"; |
7a2eedc182f7
staging: zoomable stretches. zoomToExtent etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2125
diff
changeset
|
33 import bbox from "@turf/bbox"; |
1524
a0a16577261a
Translation: mark some strings for translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1438
diff
changeset
|
34 import app from "../main"; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
35 |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
36 const LAYERS = { |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
37 OPENSTREETMAP: "Open Streetmap", |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
38 INLANDECDIS: "Inland ECDIS chart Danube", |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
39 WATERWAYAREA: "Waterway Area", |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
40 STRETCHES: "Stretches", |
2273
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2263
diff
changeset
|
41 FAIRWAYDIMENSIONSLOS1: "LOS 1 Fairway Dimensions", |
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2263
diff
changeset
|
42 FAIRWAYDIMENSIONSLOS2: "LOS 2 Fairway Dimensions", |
4eeaba4ef573
client: rename the Fairway Dimensions layers
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2263
diff
changeset
|
43 FAIRWAYDIMENSIONSLOS3: "LOS 3 Fairway Dimensions", |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
44 WATERWAYAXIS: "Waterway Axis", |
2157
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
45 WATERWAYPROFILES: "Waterway Profiles", |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
46 BOTTLENECKS: "Bottlenecks", |
2506
89c439721db2
client: new symbold for critical bottlenecks, normal bottlenecks are not marked anymore
Markus Kottlaender <markus@intevation.de>
parents:
2491
diff
changeset
|
47 BOTTLENECKSTATUS: "Critical Bottlenecks", |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
48 BOTTLENECKISOLINE: "Bottleneck isolines", |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
49 DISTANCEMARKS: "Distance marks", |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
50 DISTANCEMARKSAXIS: "Distance marks, Axis", |
2451 | 51 GAUGES: "Gauges", |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
52 DRAWTOOL: "Draw Tool", |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
53 CUTTOOL: "Cut Tool" |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
54 }; |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
55 |
2186
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
56 const moveMap = ({ view, extent, zoom, preventZoomOut }) => { |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
57 const currentZoom = view.getZoom(); |
2713
b79f5c5404c2
client: made zoom optional in moveMap/moveToExtent
Markus Kottlaender <markus@intevation.de>
parents:
2643
diff
changeset
|
58 zoom = zoom || currentZoom; |
2186
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
59 view.fit(extent, { |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
60 maxZoom: preventZoomOut ? Math.max(zoom, currentZoom) : zoom, |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
61 duration: 700 |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
62 }); |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
63 }; |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
64 |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
65 // initial state |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
66 const init = () => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
67 return { |
783
ab9604a46075
client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents:
782
diff
changeset
|
68 openLayersMap: null, |
2310
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2309
diff
changeset
|
69 initialLoad: true, |
1313
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
70 extent: { |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
71 lat: 6155376, |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
72 lon: 1819178, |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
73 zoom: 11 |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
74 }, |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
75 identifyTool: null, // event binding (singleclick, dblclick) |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
76 identifiedFeatures: [], // map features identified by clicking on the map |
1247
c14353e2cdb9
repositioning of buttons (issue225)
Markus Kottlaender <markus@intevation.de>
parents:
1237
diff
changeset
|
77 currentMeasurement: null, // distance or area from line-/polygon-/cutTool |
1237
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
78 lineTool: null, // open layers interaction object (Draw) |
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
79 polygonTool: null, // open layers interaction object (Draw) |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
80 cutTool: null, // open layers interaction object (Draw) |
1927
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
81 isolinesLegendImgDataURL: "", |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
82 layers: [ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
83 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
84 name: LAYERS.OPENSTREETMAP, |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
85 data: new TileLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
86 source: new OSM() |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
87 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
88 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
89 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
90 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
91 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
92 name: LAYERS.INLANDECDIS, |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
93 data: new TileLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
94 source: new TileWMS({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
95 preload: 1, |
1648
53f49b109f0c
client: improve ECDIS WMS map loading
Bernhard Reiter <bernhard@intevation.de>
parents:
1645
diff
changeset
|
96 url: "https://service.d4d-portal.info/wms/", |
1874
bad32adafef2
client: add real pdf generation with jspdf
Bernhard Reiter <bernhard@intevation.de>
parents:
1643
diff
changeset
|
97 crossOrigin: "anonymous", |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
98 params: { LAYERS: "d4d", VERSION: "1.1.1", TILED: true } |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
99 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
100 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
101 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
102 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
103 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
104 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
105 name: LAYERS.WATERWAYAREA, |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
106 data: new VectorLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
107 source: new VectorSource({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
108 strategy: bboxStrategy |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
109 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
110 style: new Style({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
111 stroke: new Stroke({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
112 color: "rgba(0, 102, 0, 1)", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
113 width: 2 |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
114 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
115 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
116 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
117 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
118 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
119 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
120 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
121 name: LAYERS.STRETCHES, |
1943
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
122 data: new VectorLayer({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
123 source: new VectorSource({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
124 strategy: bboxStrategy |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
125 }), |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
126 style: new Style({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
127 stroke: new Stroke({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
128 color: "rgba(250, 200, 0, .8)", |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
129 width: 2 |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
130 }), |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
131 fill: new Fill({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
132 color: "rgba(250, 200, 10, .3)" |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
133 }) |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
134 }) |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
135 }), |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
136 isVisible: false, |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
137 showInLegend: true |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
138 }, |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
139 { |
2250
23c03e2eaf4f
client: make different LOS visually distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2237
diff
changeset
|
140 name: LAYERS.FAIRWAYDIMENSIONSLOS3, |
1944
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
141 data: new VectorLayer({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
142 source: new VectorSource(), |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
143 style: function() { |
1944
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
144 return [ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
145 new Style({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
146 stroke: new Stroke({ |
2250
23c03e2eaf4f
client: make different LOS visually distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2237
diff
changeset
|
147 color: "rgba(0, 0, 255, 1.0)", |
2263
7efa29d16e77
client: make different LOS layer visually more distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2250
diff
changeset
|
148 width: 2 |
2313
ba4dfff74d3f
client: improve styles for LOS layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2309
diff
changeset
|
149 }), |
ba4dfff74d3f
client: improve styles for LOS layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2309
diff
changeset
|
150 fill: new Fill({ |
ba4dfff74d3f
client: improve styles for LOS layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2309
diff
changeset
|
151 color: "rgba(255, 255, 255, 0.4)" |
1944
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
152 }) |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
153 }), |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
154 new Style({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
155 text: new Text({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
156 font: 'bold 12px "Open Sans", "sans-serif"', |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
157 placement: "line", |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
158 fill: new Fill({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
159 color: "black" |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
160 }), |
2250
23c03e2eaf4f
client: make different LOS visually distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2237
diff
changeset
|
161 text: "LOS: 3" |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
162 //, zIndex: 10 |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
163 }) |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
164 }) |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
165 ]; |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
166 } |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
167 }), |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
168 isVisible: true, |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
169 showInLegend: true |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
170 }, |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
171 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
172 name: LAYERS.FAIRWAYDIMENSIONSLOS2, |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
173 data: new VectorLayer({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
174 source: new VectorSource(), |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
175 style: function() { |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
176 return [ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
177 new Style({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
178 stroke: new Stroke({ |
2263
7efa29d16e77
client: make different LOS layer visually more distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2250
diff
changeset
|
179 color: "rgba(0, 0, 255, 0.9)", |
2309
77adbdd24d52
client: fix drawing perormance
Bernhard Reiter <bernhard@intevation.de>
parents:
2273
diff
changeset
|
180 lineDash: [3, 6], |
2263
7efa29d16e77
client: make different LOS layer visually more distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2250
diff
changeset
|
181 lineCap: "round", |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
182 width: 2 |
2313
ba4dfff74d3f
client: improve styles for LOS layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2309
diff
changeset
|
183 }), |
ba4dfff74d3f
client: improve styles for LOS layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2309
diff
changeset
|
184 fill: new Fill({ |
ba4dfff74d3f
client: improve styles for LOS layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2309
diff
changeset
|
185 color: "rgba(240, 230, 0, 0.1)" |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
186 }) |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
187 }), |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
188 new Style({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
189 text: new Text({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
190 font: 'bold 12px "Open Sans", "sans-serif"', |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
191 placement: "line", |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
192 fill: new Fill({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
193 color: "black" |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
194 }), |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
195 text: "LOS: 2" |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
196 //, zIndex: 10 |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
197 }) |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
198 }) |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
199 ]; |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
200 } |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
201 }), |
2263
7efa29d16e77
client: make different LOS layer visually more distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2250
diff
changeset
|
202 isVisible: false, |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
203 showInLegend: true |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
204 }, |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
205 { |
2250
23c03e2eaf4f
client: make different LOS visually distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2237
diff
changeset
|
206 name: LAYERS.FAIRWAYDIMENSIONSLOS1, |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
207 data: new VectorLayer({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
208 source: new VectorSource(), |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
209 style: function() { |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
210 return [ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
211 new Style({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
212 stroke: new Stroke({ |
2263
7efa29d16e77
client: make different LOS layer visually more distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2250
diff
changeset
|
213 color: "rgba(0, 0, 255, 0.8)", |
2309
77adbdd24d52
client: fix drawing perormance
Bernhard Reiter <bernhard@intevation.de>
parents:
2273
diff
changeset
|
214 lineDash: [2, 4], |
2263
7efa29d16e77
client: make different LOS layer visually more distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2250
diff
changeset
|
215 lineCap: "round", |
7efa29d16e77
client: make different LOS layer visually more distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2250
diff
changeset
|
216 width: 2 |
2313
ba4dfff74d3f
client: improve styles for LOS layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2309
diff
changeset
|
217 }), |
ba4dfff74d3f
client: improve styles for LOS layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2309
diff
changeset
|
218 fill: new Fill({ |
ba4dfff74d3f
client: improve styles for LOS layers
Bernhard Reiter <bernhard@intevation.de>
parents:
2309
diff
changeset
|
219 color: "rgba(240, 230, 0, 0.2)" |
2125
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
220 }) |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
221 }), |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
222 new Style({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
223 text: new Text({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
224 font: 'bold 12px "Open Sans", "sans-serif"', |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
225 placement: "line", |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
226 fill: new Fill({ |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
227 color: "black" |
ea5a0e771b71
Distinct fairway layers per LOS
Markus Kottlaender <markus@intevation.de>
parents:
2108
diff
changeset
|
228 }), |
2250
23c03e2eaf4f
client: make different LOS visually distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2237
diff
changeset
|
229 text: "LOS: 1" |
1944
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
230 //, zIndex: 10 |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
231 }) |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
232 }) |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
233 ]; |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
234 } |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
235 }), |
2263
7efa29d16e77
client: make different LOS layer visually more distinct
Bernhard Reiter <bernhard@intevation.de>
parents:
2250
diff
changeset
|
236 isVisible: false, |
1944
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
237 showInLegend: true |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
238 }, |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
239 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
240 name: LAYERS.WATERWAYAXIS, |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
241 data: new VectorLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
242 source: new VectorSource({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
243 strategy: bboxStrategy |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
244 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
245 style: new Style({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
246 stroke: new Stroke({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
247 color: "rgba(0, 0, 255, .5)", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
248 lineDash: [5, 5], |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
249 width: 2 |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
250 }) |
2237
a78f19ff7cde
LAYERS.WATERWAYAXIS: Set max- and minResolution. Modelled after d4d.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2235
diff
changeset
|
251 }), |
a78f19ff7cde
LAYERS.WATERWAYAXIS: Set max- and minResolution. Modelled after d4d.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2235
diff
changeset
|
252 // TODO: Set layer in layertree active/inactive depending on |
a78f19ff7cde
LAYERS.WATERWAYAXIS: Set max- and minResolution. Modelled after d4d.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2235
diff
changeset
|
253 // resolution. |
a78f19ff7cde
LAYERS.WATERWAYAXIS: Set max- and minResolution. Modelled after d4d.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2235
diff
changeset
|
254 maxResolution: 5, |
a78f19ff7cde
LAYERS.WATERWAYAXIS: Set max- and minResolution. Modelled after d4d.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2235
diff
changeset
|
255 minResolution: 0 |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
256 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
257 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
258 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
259 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
260 { |
2157
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
261 name: LAYERS.WATERWAYPROFILES, |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
262 data: new VectorLayer({ |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
263 source: new VectorSource({ |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
264 strategy: bboxStrategy |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
265 }), |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
266 style: new Style({ |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
267 stroke: new Stroke({ |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
268 color: "rgba(0, 0, 255, .5)", |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
269 lineDash: [5, 5], |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
270 width: 2 |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
271 }) |
2235
39586a34979c
LAYERS.WATERWAYPROFILES: Set max- and minResolution. Modelled after d4d.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2224
diff
changeset
|
272 }), |
39586a34979c
LAYERS.WATERWAYPROFILES: Set max- and minResolution. Modelled after d4d.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2224
diff
changeset
|
273 maxResolution: 2.5, |
39586a34979c
LAYERS.WATERWAYPROFILES: Set max- and minResolution. Modelled after d4d.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2224
diff
changeset
|
274 minResolution: 0 |
2157
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
275 }), |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
276 isVisible: true, |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
277 showInLegend: true |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
278 }, |
8be0fbac2297
Added layer for waterway profiles.
Sascha Wilde <wilde@intevation.de>
parents:
2140
diff
changeset
|
279 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
280 name: LAYERS.BOTTLENECKS, |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
281 data: new VectorLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
282 source: new VectorSource({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
283 strategy: bboxStrategy |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
284 }), |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
285 style: function() { |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
286 return new Style({ |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
287 stroke: new Stroke({ |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
288 color: "rgba(230, 230, 10, .8)", |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
289 width: 4 |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
290 }), |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
291 fill: new Fill({ |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
292 color: "rgba(230, 230, 10, .3)" |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
293 }) |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
294 }); |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
295 } |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
296 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
297 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
298 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
299 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
300 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
301 name: LAYERS.BOTTLENECKISOLINE, |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
302 data: new TileLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
303 source: new TileWMS({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
304 preload: 0, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
305 projection: "EPSG:3857", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
306 url: window.location.origin + "/api/internal/wms", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
307 params: { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
308 LAYERS: "sounding_results_contour_lines_geoserver", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
309 VERSION: "1.1.1", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
310 TILED: true |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
311 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
312 tileLoadFunction: function(tile, src) { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
313 // console.log("calling for", tile, src); |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
314 HTTP.get(src, { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
315 headers: { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
316 "X-Gemma-Auth": localStorage.getItem("token") |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
317 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
318 responseType: "blob" |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
319 }).then(response => { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
320 tile.getImage().src = URL.createObjectURL(response.data); |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
321 }); |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
322 } // TODO tile.setState(TileState.ERROR); |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
323 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
324 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
325 isVisible: false, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
326 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
327 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
328 { |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
329 name: LAYERS.BOTTLENECKSTATUS, |
2506
89c439721db2
client: new symbold for critical bottlenecks, normal bottlenecks are not marked anymore
Markus Kottlaender <markus@intevation.de>
parents:
2491
diff
changeset
|
330 forLegendStyle: { point: true, resolution: 16 }, |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
331 data: new VectorLayer({ |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
332 source: new VectorSource({ |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
333 strategy: bboxStrategy |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
334 }), |
2506
89c439721db2
client: new symbold for critical bottlenecks, normal bottlenecks are not marked anymore
Markus Kottlaender <markus@intevation.de>
parents:
2491
diff
changeset
|
335 style: function(feature, resolution, isLegend) { |
2525
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
336 let styles = []; |
2506
89c439721db2
client: new symbold for critical bottlenecks, normal bottlenecks are not marked anymore
Markus Kottlaender <markus@intevation.de>
parents:
2491
diff
changeset
|
337 if ((feature.get("fa_critical") && resolution > 15) || isLegend) { |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
338 let bnCenter = getCenter(feature.getGeometry().getExtent()); |
2525
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
339 styles.push( |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
340 new Style({ |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
341 geometry: new Point(bnCenter), |
2526
6498267096ae
client: critical bottlenecks: use png instead of vectors for marker
Markus Kottlaender <markus@intevation.de>
parents:
2525
diff
changeset
|
342 image: new Icon({ |
6498267096ae
client: critical bottlenecks: use png instead of vectors for marker
Markus Kottlaender <markus@intevation.de>
parents:
2525
diff
changeset
|
343 src: require("../assets/marker-bottleneck-critical.png"), |
6498267096ae
client: critical bottlenecks: use png instead of vectors for marker
Markus Kottlaender <markus@intevation.de>
parents:
2525
diff
changeset
|
344 anchor: [0.5, 0.5], |
6498267096ae
client: critical bottlenecks: use png instead of vectors for marker
Markus Kottlaender <markus@intevation.de>
parents:
2525
diff
changeset
|
345 scale: isLegend ? 0.5 : 1 |
2506
89c439721db2
client: new symbold for critical bottlenecks, normal bottlenecks are not marked anymore
Markus Kottlaender <markus@intevation.de>
parents:
2491
diff
changeset
|
346 }) |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
347 }) |
2525
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
348 ); |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
349 } |
2525
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
350 if (feature.get("fa_critical") && !isLegend) { |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
351 styles.push( |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
352 new Style({ |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
353 stroke: new Stroke({ |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
354 color: "rgba(255, 0, 0, 1)", |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
355 width: 4 |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
356 }) |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
357 }) |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
358 ); |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
359 } |
8416cf343f17
client: critical bottlenecks: added red stroke color
Markus Kottlaender <markus@intevation.de>
parents:
2511
diff
changeset
|
360 return styles; |
2482
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
361 } |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
362 }), |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
363 isVisible: true, |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
364 showInLegend: true |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
365 }, |
ae1987c5beb3
client: display bottleneck status in separate layer
Markus Kottlaender <markus@intevation.de>
parents:
2446
diff
changeset
|
366 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
367 name: LAYERS.DISTANCEMARKS, |
1944
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
368 forLegendStyle: { point: true, resolution: 8 }, |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
369 data: new VectorLayer({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
370 source: new VectorSource({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
371 strategy: bboxStrategy |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
372 }) |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
373 }), |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
374 isVisible: false, |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
375 showInLegend: true |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
376 }, |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
377 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
378 name: LAYERS.DISTANCEMARKSAXIS, |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
379 forLegendStyle: { point: true, resolution: 8 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
380 data: new VectorLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
381 source: new VectorSource({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
382 strategy: bboxStrategy |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
383 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
384 style: function(feature, resolution) { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
385 if (resolution < 10) { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
386 var s = new Style({ |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
387 image: new Circle({ |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
388 radius: 5, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
389 fill: new Fill({ color: "rgba(255, 0, 0, 0.1)" }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
390 stroke: new Stroke({ color: "blue", width: 1 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
391 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
392 }); |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
393 if (resolution < 6) { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
394 s.setText( |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
395 new Text({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
396 offsetY: 12, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
397 font: '10px "Open Sans", "sans-serif"', |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
398 fill: new Fill({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
399 color: "black" |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
400 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
401 text: (feature.get("hectometre") / 10).toString() |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
402 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
403 ); |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
404 } |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
405 return s; |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
406 } else { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
407 return []; |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
408 } |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
409 } |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
410 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
411 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
412 showInLegend: true |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
413 }, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
414 { |
2451 | 415 name: LAYERS.GAUGES, |
416 forLegendStyle: { point: true, resolution: 8 }, | |
417 data: new VectorLayer({ | |
418 source: new VectorSource({ | |
419 strategy: bboxStrategy | |
420 }), | |
2568
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
421 style: function(feature, resolution, isLegend) { |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
422 return [ |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
423 new Style({ |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
424 image: new Icon({ |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
425 src: require("../assets/marker-gauge.png"), |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
426 anchor: [0.5, isLegend ? 0.5 : 1], |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
427 scale: isLegend ? 0.5 : 1 |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
428 }), |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
429 text: new Text({ |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
430 font: '10px "Open Sans", "sans-serif"', |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
431 offsetY: 8, |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
432 fill: new Fill({ |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
433 color: "white" |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
434 }), |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
435 text: feature.get("objname") |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
436 }) |
2456 | 437 }), |
2568
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
438 new Style({ |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
439 text: new Text({ |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
440 font: '10px "Open Sans", "sans-serif"', |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
441 offsetY: 7, |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
442 offsetX: -1, |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
443 fill: new Fill({ |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
444 color: "black" |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
445 }), |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
446 text: feature.get("objname") |
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
447 }) |
2451 | 448 }) |
2568
c546e38008de
client: improved gauge layer icon
Markus Kottlaender <markus@intevation.de>
parents:
2526
diff
changeset
|
449 ]; |
2451 | 450 }, |
451 maxResolution: 100, | |
452 minResolution: 0 | |
453 }), | |
454 isVisible: true, | |
2456 | 455 showInLegend: true |
2451 | 456 }, |
457 { | |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
458 name: LAYERS.DRAWTOOL, |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
459 data: new VectorLayer({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
460 source: new VectorSource({ wrapX: false }), |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
461 style: function(feature) { |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
462 // adapted from OpenLayer's LineString Arrow Example |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
463 var geometry = feature.getGeometry(); |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
464 var styles = [ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
465 // linestring |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
466 new Style({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
467 stroke: new Stroke({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
468 color: "#369aca", |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
469 width: 2 |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
470 }) |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
471 }) |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
472 ]; |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
473 |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
474 if (geometry.getType() === "LineString") { |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
475 geometry.forEachSegment(function(start, end) { |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
476 var dx = end[0] - start[0]; |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
477 var dy = end[1] - start[1]; |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
478 var rotation = Math.atan2(dy, dx); |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
479 // arrows |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
480 styles.push( |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
481 new Style({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
482 geometry: new Point(end), |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
483 image: new Icon({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
484 // we need to make sure the image is loaded by Vue Loader |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
1247
diff
changeset
|
485 src: require("../assets/linestring_arrow.png"), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
486 // fiddling with the anchor's y value does not help to |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
487 // position the image more centered on the line ending, as the |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
488 // default line style seems to be slightly uncentered in the |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
489 // anti-aliasing, but the image is not placed with subpixel |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
490 // precision |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
491 anchor: [0.75, 0.5], |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
492 rotateWithView: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
493 rotation: -rotation |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
494 }) |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
495 }) |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
496 ); |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
497 }); |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
498 } |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
499 return styles; |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
500 } |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
501 }), |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
502 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
503 showInLegend: false |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
504 }, |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
505 { |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
506 name: LAYERS.CUTTOOL, |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
507 data: new VectorLayer({ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
508 source: new VectorSource({ wrapX: false }), |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
509 style: function(feature) { |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
510 // adapted from OpenLayer's LineString Arrow Example |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
511 var geometry = feature.getGeometry(); |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
512 var styles = [ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
513 // linestring |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
514 new Style({ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
515 stroke: new Stroke({ |
1197
49740dcba52c
changed cut tool style
Markus Kottlaender <markus@intevation.de>
parents:
1158
diff
changeset
|
516 color: "#333333", |
49740dcba52c
changed cut tool style
Markus Kottlaender <markus@intevation.de>
parents:
1158
diff
changeset
|
517 width: 2, |
49740dcba52c
changed cut tool style
Markus Kottlaender <markus@intevation.de>
parents:
1158
diff
changeset
|
518 lineDash: [7, 7] |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
519 }) |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
520 }) |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
521 ]; |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
522 |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
523 if (geometry.getType() === "LineString") { |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
524 geometry.forEachSegment(function(start, end) { |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
525 var dx = end[0] - start[0]; |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
526 var dy = end[1] - start[1]; |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
527 var rotation = Math.atan2(dy, dx); |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
528 // arrows |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
529 styles.push( |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
530 new Style({ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
531 geometry: new Point(end), |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
532 image: new Icon({ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
533 // we need to make sure the image is loaded by Vue Loader |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
1247
diff
changeset
|
534 src: require("../assets/linestring_arrow_grey.png"), |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
535 // fiddling with the anchor's y value does not help to |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
536 // position the image more centered on the line ending, as the |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
537 // default line style seems to be slightly uncentered in the |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
538 // anti-aliasing, but the image is not placed with subpixel |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
539 // precision |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
540 anchor: [0.75, 0.5], |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
541 rotateWithView: true, |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
542 rotation: -rotation |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
543 }) |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
544 }) |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
545 ); |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
546 }); |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
547 } |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
548 return styles; |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
549 } |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
550 }), |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
551 isVisible: true, |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
552 showInLegend: false |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
553 } |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
554 ] |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
555 }; |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
556 }; |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
557 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
558 export default { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
559 init, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
560 namespaced: true, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
561 state: init(), |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
562 getters: { |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
563 layersForLegend: state => { |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
564 return state.layers.filter(layer => layer.showInLegend); |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
565 }, |
754
105c421f99b1
refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents:
747
diff
changeset
|
566 getLayerByName: state => name => { |
105c421f99b1
refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents:
747
diff
changeset
|
567 return state.layers.find(layer => layer.name === name); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
568 }, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
569 getVSourceByName: (state, getters) => name => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
570 return getters.getLayerByName(name).data.getSource(); |
2370
7fe2f5d334dc
client: improved identify tool readability
Markus Kottlaender <markus@intevation.de>
parents:
2314
diff
changeset
|
571 }, |
7fe2f5d334dc
client: improved identify tool readability
Markus Kottlaender <markus@intevation.de>
parents:
2314
diff
changeset
|
572 filteredIdentifiedFeatures: state => { |
7fe2f5d334dc
client: improved identify tool readability
Markus Kottlaender <markus@intevation.de>
parents:
2314
diff
changeset
|
573 return state.identifiedFeatures.filter(f => f.getId()); |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
574 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
575 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
576 mutations: { |
2310
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2309
diff
changeset
|
577 initialLoad: (state, initialLoad) => { |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2309
diff
changeset
|
578 state.initialLoad = initialLoad; |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2309
diff
changeset
|
579 }, |
1313
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
580 extent: (state, extent) => { |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
581 state.extent = extent; |
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
582 }, |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
583 setLayerVisible: (state, name) => { |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
584 const layer = state.layers.findIndex(l => l.name === name); |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
585 state.layers[layer].isVisible = true; |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
586 state.layers[layer].data.setVisible(true); |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
587 }, |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
588 setLayerInvisible: (state, name) => { |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
589 const layer = state.layers.findIndex(l => l.name === name); |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
590 state.layers[layer].isVisible = false; |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
591 state.layers[layer].data.setVisible(false); |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
592 }, |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
593 toggleVisibilityByName: (state, name) => { |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
594 const layer = state.layers.findIndex(l => l.name === name); |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
595 state.layers[layer].isVisible = !state.layers[layer].isVisible; |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
596 state.layers[layer].data.setVisible(state.layers[layer].isVisible); |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
597 }, |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
598 toggleVisibility: (state, layer) => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
599 state.layers[layer].isVisible = !state.layers[layer].isVisible; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
600 state.layers[layer].data.setVisible(state.layers[layer].isVisible); |
770
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
754
diff
changeset
|
601 }, |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
602 openLayersMap: (state, map) => { |
783
ab9604a46075
client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents:
782
diff
changeset
|
603 state.openLayersMap = map; |
1112
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
604 }, |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
605 identifyTool: (state, events) => { |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
606 state.identifyTool = events; |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
607 }, |
1112
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
608 setIdentifiedFeatures: (state, identifiedFeatures) => { |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
609 state.identifiedFeatures = identifiedFeatures; |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
610 }, |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
611 setCurrentMeasurement: (state, measurement) => { |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
612 state.currentMeasurement = measurement; |
1115
1b160eda22cf
moved drawMode to map store
Markus Kottlaender <markus@intevation.de>
parents:
1114
diff
changeset
|
613 }, |
1237
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
614 lineTool: (state, lineTool) => { |
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
615 state.lineTool = lineTool; |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
616 }, |
1237
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
617 polygonTool: (state, polygonTool) => { |
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
618 state.polygonTool = polygonTool; |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
619 }, |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
620 cutTool: (state, cutTool) => { |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
621 state.cutTool = cutTool; |
1158
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
622 }, |
2186
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
623 moveToBoundingBox: (state, { boundingBox, zoom, preventZoomOut }) => { |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
624 const extent = transformExtent(boundingBox, "EPSG:4326", "EPSG:3857"); |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
625 let view = state.openLayersMap.getView(); |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
626 moveMap({ view, extent, zoom, preventZoomOut }); |
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
627 }, |
2132
7a2eedc182f7
staging: zoomable stretches. zoomToExtent etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2125
diff
changeset
|
628 moveToExtent: (state, { feature, zoom, preventZoomOut }) => { |
7a2eedc182f7
staging: zoomable stretches. zoomToExtent etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2125
diff
changeset
|
629 const boundingBox = bbox(feature.geometry); |
7a2eedc182f7
staging: zoomable stretches. zoomToExtent etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2125
diff
changeset
|
630 const extent = transformExtent(boundingBox, "EPSG:4326", "EPSG:3857"); |
2108
cac5d2fba591
bbox tool from turfjs added. zoomToExtent function added to map.js
Thomas Junk <thomas.junk@intevation.de>
parents:
2101
diff
changeset
|
631 let view = state.openLayersMap.getView(); |
2186
d0498088894f
map_store: extracted moveMap, etd moveToBoundingBox, refactored moveToExtent
Thomas Junk <thomas.junk@intevation.de>
parents:
2166
diff
changeset
|
632 moveMap({ view, extent, zoom, preventZoomOut }); |
2108
cac5d2fba591
bbox tool from turfjs added. zoomToExtent function added to map.js
Thomas Junk <thomas.junk@intevation.de>
parents:
2101
diff
changeset
|
633 }, |
1158
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
634 moveMap: (state, { coordinates, zoom, preventZoomOut }) => { |
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
635 let view = state.openLayersMap.getView(); |
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
636 const currentZoom = view.getZoom(); |
2713
b79f5c5404c2
client: made zoom optional in moveMap/moveToExtent
Markus Kottlaender <markus@intevation.de>
parents:
2643
diff
changeset
|
637 zoom = zoom || currentZoom; |
1158
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
638 view.animate({ |
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
639 zoom: preventZoomOut ? Math.max(zoom, currentZoom) : zoom, |
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
640 center: fromLonLat(coordinates, view.getProjection()), |
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
641 duration: 700 |
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
642 }); |
1927
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
643 }, |
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
644 isolinesLegendImgDataURL: (state, isolinesLegendImgDataURL) => { |
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
645 state.isolinesLegendImgDataURL = isolinesLegendImgDataURL; |
1144 | 646 } |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
647 }, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
648 actions: { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
649 openLayersMap({ commit, dispatch, getters }, map) { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
650 const drawVectorSrc = getters.getVSourceByName("Draw Tool"); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
651 const cutVectorSrc = getters.getVSourceByName("Cut Tool"); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
652 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
653 // init line tool |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
654 const lineTool = new Draw({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
655 source: drawVectorSrc, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
656 type: "LineString", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
657 maxPoints: 2 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
658 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
659 lineTool.setActive(false); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
660 lineTool.on("drawstart", () => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
661 drawVectorSrc.clear(); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
662 commit("setCurrentMeasurement", null); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
663 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
664 lineTool.on("drawend", event => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
665 commit("setCurrentMeasurement", { |
1524
a0a16577261a
Translation: mark some strings for translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1438
diff
changeset
|
666 quantity: app.$gettext("Length"), |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
667 unitSymbol: "m", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
668 value: Math.round(getLength(event.feature.getGeometry()) * 10) / 10 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
669 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
670 commit("application/showIdentify", true, { root: true }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
671 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
672 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
673 // init polygon tool |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
674 const polygonTool = new Draw({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
675 source: drawVectorSrc, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
676 type: "Polygon", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
677 maxPoints: 50 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
678 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
679 polygonTool.setActive(false); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
680 polygonTool.on("drawstart", () => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
681 drawVectorSrc.clear(); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
682 commit("setCurrentMeasurement", null); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
683 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
684 polygonTool.on("drawend", event => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
685 const areaSize = getArea(event.feature.getGeometry()); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
686 commit("setCurrentMeasurement", { |
1524
a0a16577261a
Translation: mark some strings for translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1438
diff
changeset
|
687 quantity: app.$gettext("Area"), |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
688 unitSymbol: areaSize > 100000 ? "km²" : "m²", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
689 value: |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
690 areaSize > 100000 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
691 ? Math.round(areaSize / 1000) / 1000 // convert into 1 km² == 1000*1000 m² and round to 1000 m² |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
692 : Math.round(areaSize) |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
693 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
694 commit("application/showIdentify", true, { root: true }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
695 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
696 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
697 // init cut tool |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
698 const cutTool = new Draw({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
699 source: cutVectorSrc, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
700 type: "LineString", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
701 maxPoints: 2, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
702 style: new Style({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
703 stroke: new Stroke({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
704 color: "#444", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
705 width: 2, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
706 lineDash: [7, 7] |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
707 }), |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
708 image: new Circle({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
709 fill: new Fill({ color: "#333" }), |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
710 stroke: new Stroke({ color: "#fff", width: 1.5 }), |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
711 radius: 6 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
712 }) |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
713 }) |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
714 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
715 cutTool.setActive(false); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
716 cutTool.on("drawstart", () => { |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
717 dispatch("disableIdentifyTool"); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
718 cutVectorSrc.clear(); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
719 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
720 cutTool.on("drawend", event => { |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1363
diff
changeset
|
721 commit("fairwayprofile/selectedCut", null, { root: true }); |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
722 dispatch("fairwayprofile/cut", event.feature, { root: true }).then(() => |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
723 // This setTimeout is an ugly workaround. If we would enable the |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
724 // identifyTool here immediately then the click event from ending the |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
725 // cut will trigger it. We don't want that. |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
726 setTimeout(() => dispatch("enableIdentifyTool"), 1000) |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
727 ); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
728 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
729 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
730 map.addInteraction(lineTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
731 map.addInteraction(cutTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
732 map.addInteraction(polygonTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
733 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
734 commit("lineTool", lineTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
735 commit("polygonTool", polygonTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
736 commit("cutTool", cutTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
737 commit("openLayersMap", map); |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
738 }, |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
739 disableIdentifyTool({ state }) { |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
740 unByKey(state.identifyTool); |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
741 state.identifyTool = null; |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
742 }, |
1438
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
743 enableIdentifyTool({ state, rootState, commit, dispatch, getters }) { |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
744 if (!state.identifyTool) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
745 state.identifyTool = state.openLayersMap.on( |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
746 ["singleclick", "dblclick"], |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
747 event => { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
748 commit("setIdentifiedFeatures", []); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
749 // checking our WFS layers |
2166
69c49301d689
map.js: GetFeaturesAtPixel added hitTolerance:7.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2157
diff
changeset
|
750 var features = state.openLayersMap.getFeaturesAtPixel(event.pixel, { |
69c49301d689
map.js: GetFeaturesAtPixel added hitTolerance:7.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2157
diff
changeset
|
751 hitTolerance: 7 |
69c49301d689
map.js: GetFeaturesAtPixel added hitTolerance:7.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2157
diff
changeset
|
752 }); |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
753 if (features) { |
2510
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
754 let identifiedFeatures = []; |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
755 |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
756 for (let feature of features) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
757 let id = feature.getId(); |
2510
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
758 |
2511
e958104be9a9
removed console.log, added comment
Markus Kottlaender <markus@intevation.de>
parents:
2510
diff
changeset
|
759 // avoid identifying the same feature twice |
2510
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
760 if ( |
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
761 identifiedFeatures.findIndex( |
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
762 f => f.getId() === feature.getId() |
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
763 ) === -1 |
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
764 ) { |
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
765 identifiedFeatures.push(feature); |
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
766 } |
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
767 |
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
768 // get selected bottleneck |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
769 // RegExp.prototype.test() works with number, str and undefined |
2133
602c2096c078
fix: bottleneckselection via identifytool
Thomas Junk <thomas.junk@intevation.de>
parents:
2132
diff
changeset
|
770 if (/^bottlenecks/.test(id)) { |
1438
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
771 if ( |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
772 rootState.bottlenecks.selectedBottleneck != |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
773 feature.get("objnam") |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
774 ) { |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
775 dispatch( |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
776 "bottlenecks/setSelectedBottleneck", |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
777 feature.get("objnam"), |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
778 { root: true } |
1565
faa045ebdf0c
select first surveydate after identification of bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents:
1524
diff
changeset
|
779 ).then(() => { |
faa045ebdf0c
select first surveydate after identification of bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents:
1524
diff
changeset
|
780 this.commit("bottlenecks/setFirstSurveySelected"); |
faa045ebdf0c
select first surveydate after identification of bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents:
1524
diff
changeset
|
781 }); |
1438
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
782 commit("moveMap", { |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
783 coordinates: getCenter( |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
784 feature |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
785 .getGeometry() |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
786 .clone() |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
787 .transform("EPSG:3857", "EPSG:4326") |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
788 .getExtent() |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
789 ), |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
790 zoom: 17, |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
791 preventZoomOut: true |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
792 }); |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
793 } |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
794 } |
2590
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
795 |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
796 // get selected gauge |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
797 if (/^gauges/.test(id)) { |
2596
8774054959a7
client: added Gauges dialog/tool to show waterlevel diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2590
diff
changeset
|
798 if ( |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2604
diff
changeset
|
799 rootState.gauges.selectedGaugeISRS !== |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2604
diff
changeset
|
800 feature.get("isrs_code") |
2596
8774054959a7
client: added Gauges dialog/tool to show waterlevel diagrams
Markus Kottlaender <markus@intevation.de>
parents:
2590
diff
changeset
|
801 ) { |
2604
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2596
diff
changeset
|
802 dispatch( |
2643
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2604
diff
changeset
|
803 "gauges/selectedGaugeISRS", |
27933e66e848
client: gauges: use isrs_code as unique id for gauges
Markus Kottlaender <markus@intevation.de>
parents:
2604
diff
changeset
|
804 feature.get("isrs_code"), |
2604
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2596
diff
changeset
|
805 { |
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2596
diff
changeset
|
806 root: true |
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2596
diff
changeset
|
807 } |
85f9bf4a6eba
client: gauge waterlevel diagram: draw reference waterlevels
Markus Kottlaender <markus@intevation.de>
parents:
2596
diff
changeset
|
808 ); |
2590
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
809 commit("moveMap", { |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
810 coordinates: getCenter( |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
811 feature |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
812 .getGeometry() |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
813 .clone() |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
814 .transform("EPSG:3857", "EPSG:4326") |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
815 .getExtent() |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
816 ), |
2713
b79f5c5404c2
client: made zoom optional in moveMap/moveToExtent
Markus Kottlaender <markus@intevation.de>
parents:
2643
diff
changeset
|
817 zoom: null, |
2590
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
818 preventZoomOut: true |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
819 }); |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
820 } |
1686ec185155
client: added gauge waterlevel example diagram
Markus Kottlaender <markus@intevation.de>
parents:
2568
diff
changeset
|
821 } |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
822 } |
2510
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
823 |
f2758dafe390
client: identify tool: avoid identifying the same feature twice
Markus Kottlaender <markus@intevation.de>
parents:
2506
diff
changeset
|
824 commit("setIdentifiedFeatures", identifiedFeatures); |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
825 } |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
826 |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
827 // DEBUG output and example how to remove the GeometryName |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
828 /* |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
829 for (let feature of features) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
830 console.log("Identified:", feature.getId()); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
831 for (let key of feature.getKeys()) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
832 if (key != feature.getGeometryName()) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
833 console.log(key, feature.get(key)); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
834 } |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
835 } |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
836 } |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
837 */ |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
838 |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
839 // trying the GetFeatureInfo way for WMS |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
840 var wmsSource = getters.getVSourceByName( |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
841 "Inland ECDIS chart Danube" |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
842 ); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
843 var url = wmsSource.getGetFeatureInfoUrl( |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
844 event.coordinate, |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
845 100 /* resolution */, |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
846 "EPSG:3857", |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
847 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
848 { INFO_FORMAT: "text/plain" } |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
849 ); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
850 |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
851 if (url) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
852 // cannot directly query here because of SOP |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
853 console.log("GetFeatureInfo url:", url); |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
854 } |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
855 } |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
856 ); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
857 } |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
858 } |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
859 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
860 }; |
2140
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
861 |
55bedb39295a
feat: clicking on stretches activates according layer
Thomas Junk <thomas.junk@intevation.de>
parents:
2133
diff
changeset
|
862 export { LAYERS }; |