Mercurial > gemma
annotate client/src/store/map.js @ 1971:9a989d563e12
Translated using Weblate (Austrian German)
Currently translated at 55.4% (123 of 222 strings)
Translation: Gemma/client
Translate-URL: https://hosted.weblate.org/projects/gemma/client/de_AT/
author | Bernhard E. Reiter <bernhard.reiter@intevation.de> |
---|---|
date | Wed, 23 Jan 2019 12:14:53 +0000 |
parents | ef1184654839 |
children | 9372e4604a2c |
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"; |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
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"; |
1524
a0a16577261a
Translation: mark some strings for translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1438
diff
changeset
|
32 import app from "../main"; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
33 |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
34 // initial state |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
35 const init = () => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
36 return { |
783
ab9604a46075
client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents:
782
diff
changeset
|
37 openLayersMap: null, |
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
|
38 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
|
39 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
|
40 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
|
41 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
|
42 }, |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
43 identifyTool: null, // event binding (singleclick, dblclick) |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
44 identifiedFeatures: [], // map features identified by clicking on the map |
1247
c14353e2cdb9
repositioning of buttons (issue225)
Markus Kottlaender <markus@intevation.de>
parents:
1237
diff
changeset
|
45 currentMeasurement: null, // distance or area from line-/polygon-/cutTool |
1237
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
46 lineTool: null, // open layers interaction object (Draw) |
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
47 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
|
48 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
|
49 isolinesLegendImgDataURL: "", |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
50 layers: [ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
51 { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
52 name: "Open Streetmap", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
53 data: new TileLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
54 source: new OSM() |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
55 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
56 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
57 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
58 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
59 { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
60 name: "Inland ECDIS chart Danube", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
61 data: new TileLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
62 source: new TileWMS({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
63 preload: 1, |
1648
53f49b109f0c
client: improve ECDIS WMS map loading
Bernhard Reiter <bernhard@intevation.de>
parents:
1645
diff
changeset
|
64 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
|
65 crossOrigin: "anonymous", |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
66 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
|
67 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
68 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
69 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
70 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
71 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
72 { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
73 name: "Waterway Area", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
74 data: new VectorLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
75 source: new VectorSource({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
76 strategy: bboxStrategy |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
77 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
78 style: new Style({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
79 stroke: new Stroke({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
80 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
|
81 width: 2 |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
82 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
83 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
84 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
85 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
86 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
87 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
88 { |
1943
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
89 name: "Stretches", |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
90 data: new VectorLayer({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
91 source: new VectorSource({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
92 strategy: bboxStrategy |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
93 }), |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
94 style: new Style({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
95 stroke: new Stroke({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
96 color: "rgba(250, 200, 0, .8)", |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
97 width: 2 |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
98 }), |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
99 fill: new Fill({ |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
100 color: "rgba(250, 200, 10, .3)" |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
101 }) |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
102 }) |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
103 }), |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
104 isVisible: false, |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
105 showInLegend: true |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
106 }, |
52a6e63d5dcc
Added stretches layer, removed WW-Area named.
Sascha Wilde <wilde@intevation.de>
parents:
1927
diff
changeset
|
107 { |
1944
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
108 name: "Fairway Dimensions", |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
109 data: new VectorLayer({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
110 source: new VectorSource(), |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
111 style: function(feature) { |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
112 return [ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
113 new Style({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
114 stroke: new Stroke({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
115 color: "rgba(0, 0, 255, 1.0)", |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
116 width: 2 |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
117 }) |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
118 }), |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
119 new Style({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
120 text: new Text({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
121 font: 'bold 12px "Open Sans", "sans-serif"', |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
122 placement: "line", |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
123 fill: new Fill({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
124 color: "black" |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
125 }), |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
126 text: "LOS: " + feature.get("level_of_service").toString() |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
127 //, zIndex: 10 |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
128 }) |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
129 }) |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
130 ]; |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
131 } |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
132 }), |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
133 isVisible: true, |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
134 showInLegend: true |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
135 }, |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
136 { |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
137 name: "Waterway Axis", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
138 data: new VectorLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
139 source: new VectorSource({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
140 strategy: bboxStrategy |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
141 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
142 style: new Style({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
143 stroke: new Stroke({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
144 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
|
145 lineDash: [5, 5], |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
146 width: 2 |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
147 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
148 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
149 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
150 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
151 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
152 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
153 { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
154 name: "Bottlenecks", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
155 data: new VectorLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
156 source: new VectorSource({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
157 strategy: bboxStrategy |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
158 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
159 style: new Style({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
160 stroke: new Stroke({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
161 color: "rgba(230, 230, 10, .8)", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
162 width: 4 |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
163 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
164 fill: new Fill({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
165 color: "rgba(230, 230, 10, .3)" |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
166 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
167 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
168 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
169 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
170 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
171 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
172 { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
173 name: "Bottleneck isolines", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
174 data: new TileLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
175 source: new TileWMS({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
176 preload: 0, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
177 projection: "EPSG:3857", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
178 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
|
179 params: { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
180 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
|
181 VERSION: "1.1.1", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
182 TILED: true |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
183 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
184 tileLoadFunction: function(tile, src) { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
185 // 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
|
186 HTTP.get(src, { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
187 headers: { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
188 "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
|
189 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
190 responseType: "blob" |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
191 }).then(response => { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
192 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
|
193 }); |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
194 } // 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
|
195 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
196 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
197 isVisible: false, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
198 showInLegend: true |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
199 }, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
200 { |
1944
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
201 name: "Distance marks", |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
202 forLegendStyle: { point: true, resolution: 8 }, |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
203 data: new VectorLayer({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
204 source: new VectorSource({ |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
205 strategy: bboxStrategy |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
206 }) |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
207 }), |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
208 isVisible: false, |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
209 showInLegend: true |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
210 }, |
ef1184654839
Order layers a bit less arbitrary.
Sascha Wilde <wilde@intevation.de>
parents:
1943
diff
changeset
|
211 { |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
212 name: "Distance marks, Axis", |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
213 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
|
214 data: new VectorLayer({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
215 source: new VectorSource({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
216 strategy: bboxStrategy |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
217 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
218 style: function(feature, resolution) { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
219 if (resolution < 10) { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
220 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
|
221 image: new Circle({ |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
222 radius: 5, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
223 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
|
224 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
|
225 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
226 }); |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
227 if (resolution < 6) { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
228 s.setText( |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
229 new Text({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
230 offsetY: 12, |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
231 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
|
232 fill: new Fill({ |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
233 color: "black" |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
234 }), |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
235 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
|
236 }) |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
237 ); |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
238 } |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
239 return s; |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
240 } else { |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
241 return []; |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
242 } |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
243 } |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
244 }), |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
245 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
246 showInLegend: true |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
247 }, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
248 { |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
249 name: "Draw Tool", |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
250 data: new VectorLayer({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
251 source: new VectorSource({ wrapX: false }), |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
252 style: function(feature) { |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
253 // 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
|
254 var geometry = feature.getGeometry(); |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
255 var styles = [ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
256 // linestring |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
257 new Style({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
258 stroke: new Stroke({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
259 color: "#369aca", |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
260 width: 2 |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
261 }) |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
262 }) |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
263 ]; |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
264 |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
265 if (geometry.getType() === "LineString") { |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
266 geometry.forEachSegment(function(start, end) { |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
267 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
|
268 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
|
269 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
|
270 // arrows |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
271 styles.push( |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
272 new Style({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
273 geometry: new Point(end), |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
274 image: new Icon({ |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
275 // 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
|
276 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
|
277 // 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
|
278 // 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
|
279 // 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
|
280 // 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
|
281 // precision |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
282 anchor: [0.75, 0.5], |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
283 rotateWithView: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
284 rotation: -rotation |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
285 }) |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
286 }) |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
287 ); |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
288 }); |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
289 } |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
290 return styles; |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
291 } |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
292 }), |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
293 isVisible: true, |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
294 showInLegend: false |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
295 }, |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
296 { |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
297 name: "Cut Tool", |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
298 data: new VectorLayer({ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
299 source: new VectorSource({ wrapX: false }), |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
300 style: function(feature) { |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
301 // adapted from OpenLayer's LineString Arrow Example |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
302 var geometry = feature.getGeometry(); |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
303 var styles = [ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
304 // linestring |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
305 new Style({ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
306 stroke: new Stroke({ |
1197
49740dcba52c
changed cut tool style
Markus Kottlaender <markus@intevation.de>
parents:
1158
diff
changeset
|
307 color: "#333333", |
49740dcba52c
changed cut tool style
Markus Kottlaender <markus@intevation.de>
parents:
1158
diff
changeset
|
308 width: 2, |
49740dcba52c
changed cut tool style
Markus Kottlaender <markus@intevation.de>
parents:
1158
diff
changeset
|
309 lineDash: [7, 7] |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
310 }) |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
311 }) |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
312 ]; |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
313 |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
314 if (geometry.getType() === "LineString") { |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
315 geometry.forEachSegment(function(start, end) { |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
316 var dx = end[0] - start[0]; |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
317 var dy = end[1] - start[1]; |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
318 var rotation = Math.atan2(dy, dx); |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
319 // arrows |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
320 styles.push( |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
321 new Style({ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
322 geometry: new Point(end), |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
323 image: new Icon({ |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
324 // 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
|
325 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
|
326 // 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
|
327 // 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
|
328 // 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
|
329 // 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
|
330 // precision |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
331 anchor: [0.75, 0.5], |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
332 rotateWithView: true, |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
333 rotation: -rotation |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
334 }) |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
335 }) |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
336 ); |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
337 }); |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
338 } |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
339 return styles; |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
340 } |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
341 }), |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
342 isVisible: true, |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
343 showInLegend: false |
1099
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
344 } |
1f4799bab8a6
deleted layers/layers.js and moved content to map store
Markus Kottlaender <markus@intevation.de>
parents:
1096
diff
changeset
|
345 ] |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
346 }; |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
347 }; |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
348 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
349 export default { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
350 init, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
351 namespaced: true, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
352 state: init(), |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
353 getters: { |
1121
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
354 layersForLegend: state => { |
035dc35e1dfc
moved draw layer in map store's layers property
Markus Kottlaender <markus@intevation.de>
parents:
1115
diff
changeset
|
355 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
|
356 }, |
754
105c421f99b1
refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents:
747
diff
changeset
|
357 getLayerByName: state => name => { |
105c421f99b1
refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents:
747
diff
changeset
|
358 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
|
359 }, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
360 getVSourceByName: (state, getters) => name => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
361 return getters.getLayerByName(name).data.getSource(); |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
362 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
363 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
364 mutations: { |
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
|
365 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
|
366 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
|
367 }, |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
368 toggleVisibility: (state, layer) => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
369 state.layers[layer].isVisible = !state.layers[layer].isVisible; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
370 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
|
371 }, |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
372 openLayersMap: (state, map) => { |
783
ab9604a46075
client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents:
782
diff
changeset
|
373 state.openLayersMap = map; |
1112
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
374 }, |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
375 identifyTool: (state, events) => { |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
376 state.identifyTool = events; |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
377 }, |
1112
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
378 setIdentifiedFeatures: (state, identifiedFeatures) => { |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
379 state.identifiedFeatures = identifiedFeatures; |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
380 }, |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
381 setCurrentMeasurement: (state, measurement) => { |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
382 state.currentMeasurement = measurement; |
1115
1b160eda22cf
moved drawMode to map store
Markus Kottlaender <markus@intevation.de>
parents:
1114
diff
changeset
|
383 }, |
1237
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
384 lineTool: (state, lineTool) => { |
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
385 state.lineTool = lineTool; |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
386 }, |
1237
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
387 polygonTool: (state, polygonTool) => { |
74562dc29e10
refactored drawtool
Markus Kottlaender <markus@intevation.de>
parents:
1197
diff
changeset
|
388 state.polygonTool = polygonTool; |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
389 }, |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
390 cutTool: (state, cutTool) => { |
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
391 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
|
392 }, |
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
393 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
|
394 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
|
395 const currentZoom = view.getZoom(); |
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
396 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
|
397 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
|
398 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
|
399 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
|
400 }); |
1927
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
401 }, |
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
402 isolinesLegendImgDataURL: (state, isolinesLegendImgDataURL) => { |
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
403 state.isolinesLegendImgDataURL = isolinesLegendImgDataURL; |
1144 | 404 } |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
405 }, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
406 actions: { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
407 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
|
408 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
|
409 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
|
410 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
411 // init line tool |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
412 const lineTool = new Draw({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
413 source: drawVectorSrc, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
414 type: "LineString", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
415 maxPoints: 2 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
416 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
417 lineTool.setActive(false); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
418 lineTool.on("drawstart", () => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
419 drawVectorSrc.clear(); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
420 commit("setCurrentMeasurement", null); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
421 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
422 lineTool.on("drawend", event => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
423 commit("setCurrentMeasurement", { |
1524
a0a16577261a
Translation: mark some strings for translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1438
diff
changeset
|
424 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
|
425 unitSymbol: "m", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
426 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
|
427 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
428 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
|
429 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
430 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
431 // init polygon tool |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
432 const polygonTool = new Draw({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
433 source: drawVectorSrc, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
434 type: "Polygon", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
435 maxPoints: 50 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
436 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
437 polygonTool.setActive(false); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
438 polygonTool.on("drawstart", () => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
439 drawVectorSrc.clear(); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
440 commit("setCurrentMeasurement", null); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
441 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
442 polygonTool.on("drawend", event => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
443 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
|
444 commit("setCurrentMeasurement", { |
1524
a0a16577261a
Translation: mark some strings for translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1438
diff
changeset
|
445 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
|
446 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
|
447 value: |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
448 areaSize > 100000 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
449 ? 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
|
450 : Math.round(areaSize) |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
451 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
452 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
|
453 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
454 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
455 // init cut tool |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
456 const cutTool = new Draw({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
457 source: cutVectorSrc, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
458 type: "LineString", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
459 maxPoints: 2, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
460 style: new Style({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
461 stroke: new Stroke({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
462 color: "#444", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
463 width: 2, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
464 lineDash: [7, 7] |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
465 }), |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
466 image: new Circle({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
467 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
|
468 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
|
469 radius: 6 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
470 }) |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
471 }) |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
472 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
473 cutTool.setActive(false); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
474 cutTool.on("drawstart", () => { |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
475 dispatch("disableIdentifyTool"); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
476 cutVectorSrc.clear(); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
477 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
478 cutTool.on("drawend", event => { |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1363
diff
changeset
|
479 commit("fairwayprofile/selectedCut", null, { root: true }); |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
480 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
|
481 // 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
|
482 // 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
|
483 // 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
|
484 setTimeout(() => dispatch("enableIdentifyTool"), 1000) |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
485 ); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
486 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
487 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
488 map.addInteraction(lineTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
489 map.addInteraction(cutTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
490 map.addInteraction(polygonTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
491 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
492 commit("lineTool", lineTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
493 commit("polygonTool", polygonTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
494 commit("cutTool", cutTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
495 commit("openLayersMap", map); |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
496 }, |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
497 disableIdentifyTool({ state }) { |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
498 unByKey(state.identifyTool); |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
499 state.identifyTool = null; |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
500 }, |
1438
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
501 enableIdentifyTool({ state, rootState, commit, dispatch, getters }) { |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
502 if (!state.identifyTool) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
503 state.identifyTool = state.openLayersMap.on( |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
504 ["singleclick", "dblclick"], |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
505 event => { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
506 commit("setIdentifiedFeatures", []); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
507 // checking our WFS layers |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
508 var features = state.openLayersMap.getFeaturesAtPixel(event.pixel); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
509 if (features) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
510 commit("setIdentifiedFeatures", features); |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
511 |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
512 // get selected bottleneck from identified features |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
513 for (let feature of features) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
514 let id = feature.getId(); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
515 // RegExp.prototype.test() works with number, str and undefined |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
516 if (/^bottlenecks\./.test(id)) { |
1438
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
517 if ( |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
518 rootState.bottlenecks.selectedBottleneck != |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
519 feature.get("objnam") |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
520 ) { |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
521 dispatch( |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
522 "bottlenecks/setSelectedBottleneck", |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
523 feature.get("objnam"), |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
524 { root: true } |
1565
faa045ebdf0c
select first surveydate after identification of bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents:
1524
diff
changeset
|
525 ).then(() => { |
faa045ebdf0c
select first surveydate after identification of bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents:
1524
diff
changeset
|
526 this.commit("bottlenecks/setFirstSurveySelected"); |
faa045ebdf0c
select first surveydate after identification of bottleneck
Thomas Junk <thomas.junk@intevation.de>
parents:
1524
diff
changeset
|
527 }); |
1438
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
528 commit("moveMap", { |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
529 coordinates: getCenter( |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
530 feature |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
531 .getGeometry() |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
532 .clone() |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
533 .transform("EPSG:3857", "EPSG:4326") |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
534 .getExtent() |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
535 ), |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
536 zoom: 17, |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
537 preventZoomOut: true |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
538 }); |
71eb96690f91
avoid unnecessary setSelectedBottleneck call
Markus Kottlaender <markus@intevation.de>
parents:
1437
diff
changeset
|
539 } |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
540 } |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
541 } |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
542 } |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
543 |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
544 // 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
|
545 /* |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
546 for (let feature of features) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
547 console.log("Identified:", feature.getId()); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
548 for (let key of feature.getKeys()) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
549 if (key != feature.getGeometryName()) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
550 console.log(key, feature.get(key)); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
551 } |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
552 } |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
553 } |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
554 */ |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
555 |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
556 // trying the GetFeatureInfo way for WMS |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
557 var wmsSource = getters.getVSourceByName( |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
558 "Inland ECDIS chart Danube" |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
559 ); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
560 var url = wmsSource.getGetFeatureInfoUrl( |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
561 event.coordinate, |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
562 100 /* resolution */, |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
563 "EPSG:3857", |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
564 // { 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
|
565 { INFO_FORMAT: "text/plain" } |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
566 ); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
567 |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
568 if (url) { |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
569 // cannot directly query here because of SOP |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
570 console.log("GetFeatureInfo url:", url); |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
571 } |
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
572 } |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
573 ); |
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
574 } |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
575 } |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
576 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
577 }; |