Mercurial > gemma
annotate client/src/store/map.js @ 5148:004f41497f97
client: remove Gauge from the refreshed layers with time slider
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Wed, 01 Apr 2020 11:10:39 +0200 |
parents | 99ece290b9a9 |
children | 482046e5b63b |
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 |
4984
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
17 import { Circle, Fill, Stroke, Style } from "ol/style"; |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
18 import { getArea, getLength } from "ol/sphere"; |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
19 |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2957
diff
changeset
|
20 import Draw from "ol/interaction/Draw"; |
4984
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
21 import Feature from "ol/Feature"; |
3029
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3006
diff
changeset
|
22 import { HTTP } from "@/lib/http"; |
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3006
diff
changeset
|
23 import Point from "ol/geom/Point"; |
3409
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
24 import { Vector as VectorLayer } from "ol/layer"; |
4984
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
25 import app from "@/main"; |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
26 import bbox from "@turf/bbox"; |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
27 import { fromLonLat } from "ol/proj"; |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
28 import { toLonLat } from "ol/proj"; |
4984
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
29 import { transformExtent } from "ol/proj"; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
30 |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
31 // initial state |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
32 const init = () => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
33 return { |
4865
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
34 oldLayerVisibility: [], |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
35 singleLayerVisible: false, |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
36 openLayersMaps: [], |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3081
diff
changeset
|
37 syncedMaps: [], |
3063
333aff79197d
client: maps: all map's views are now synced
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
38 syncedView: null, |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
39 mapPopup: null, |
3261
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
40 mapPopupEnabled: true, |
2310
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2309
diff
changeset
|
41 initialLoad: true, |
1313
e4e35fb2d995
save map extent (center/zoom) in store, to not lose it when switching between map and admin area
Markus Kottlaender <markus@intevation.de>
parents:
1296
diff
changeset
|
42 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
|
43 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
|
44 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
|
45 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
|
46 }, |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
47 identifiedFeatures: [], // map features identified by clicking on the map |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
48 identifiedCoordinates: null, |
1247
c14353e2cdb9
repositioning of buttons (issue225)
Markus Kottlaender <markus@intevation.de>
parents:
1237
diff
changeset
|
49 currentMeasurement: null, // distance or area from line-/polygon-/cutTool |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
50 lineToolEnabled: false, |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
51 polygonToolEnabled: false, |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
52 cutToolEnabled: false, |
1927
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
53 isolinesLegendImgDataURL: "", |
4271
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
3851
diff
changeset
|
54 differencesLegendImgDataURL: "", |
4368
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
55 ongoingRefresh: false, |
5075
aeb100b4c41b
timeslider: prerequisites for time travel
Thomas Junk <thomas.junk@intevation.de>
parents:
4984
diff
changeset
|
56 ongoingTimeSlide: false, |
4368
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
57 reviewActive: false |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
58 }; |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
59 }; |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
60 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
61 export default { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
62 init, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
63 namespaced: true, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
64 state: init(), |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
65 getters: { |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
66 openLayersMap: state => id => { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
67 return state.openLayersMaps.find( |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
68 map => map.getTarget() === "map-" + (id || "main") |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
69 ); |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
70 }, |
2370
7fe2f5d334dc
client: improved identify tool readability
Markus Kottlaender <markus@intevation.de>
parents:
2314
diff
changeset
|
71 filteredIdentifiedFeatures: state => { |
7fe2f5d334dc
client: improved identify tool readability
Markus Kottlaender <markus@intevation.de>
parents:
2314
diff
changeset
|
72 return state.identifiedFeatures.filter(f => f.getId()); |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
73 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
74 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
75 mutations: { |
4865
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
76 viewSingleLayer: (state, layerId) => { |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
77 state.singleLayerVisible = !state.singleLayerVisible; |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
78 if (state.singleLayerVisible) { |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
79 state.oldLayerVisibility = state.openLayersMaps.reduce((o, m) => { |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
80 let current = []; |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
81 m.getLayers().forEach(l => { |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
82 current.push(l.getVisible()); |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
83 l.setVisible(l.get("id") == layerId); |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
84 }); |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
85 o.push(current); |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
86 return o; |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
87 }, []); |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
88 } else { |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
89 state.oldLayerVisibility.forEach((m, i) => { |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
90 let layers = state.openLayersMaps[i].getLayers().getArray(); |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
91 m.forEach((visible, index) => { |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
92 layers[index].setVisible(visible); |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
93 }); |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
94 }); |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
95 } |
e51b9b265df0
right click toggles single layer selection
Thomas Junk <thomas.junk@intevation.de>
parents:
4688
diff
changeset
|
96 }, |
4368
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
97 reviewActive: (state, active) => { |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
98 state.reviewActive = active; |
e9d2573329da
import_overview: make layer for review togglable (currently only for development visible)
Thomas Junk <thomas.junk@intevation.de>
parents:
4277
diff
changeset
|
99 }, |
4271
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
3851
diff
changeset
|
100 startRefreshLayers: state => { |
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
3851
diff
changeset
|
101 state.ongoingRefresh = true; |
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
3851
diff
changeset
|
102 }, |
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
3851
diff
changeset
|
103 finishRefreshLayers: state => { |
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
3851
diff
changeset
|
104 state.ongoingRefresh = false; |
315474a66589
Map: refreshing layers triggers reloading of styles
Thomas Junk <thomas.junk@intevation.de>
parents:
3851
diff
changeset
|
105 }, |
5075
aeb100b4c41b
timeslider: prerequisites for time travel
Thomas Junk <thomas.junk@intevation.de>
parents:
4984
diff
changeset
|
106 startTimeSlide: state => { |
5079
32948cba9824
client: correct states for time-slider in store
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5077
diff
changeset
|
107 state.ongoingTimeSlide = true; |
5075
aeb100b4c41b
timeslider: prerequisites for time travel
Thomas Junk <thomas.junk@intevation.de>
parents:
4984
diff
changeset
|
108 }, |
aeb100b4c41b
timeslider: prerequisites for time travel
Thomas Junk <thomas.junk@intevation.de>
parents:
4984
diff
changeset
|
109 finishTimeSlide: state => { |
5079
32948cba9824
client: correct states for time-slider in store
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5077
diff
changeset
|
110 state.ongoingTimeSlide = false; |
5075
aeb100b4c41b
timeslider: prerequisites for time travel
Thomas Junk <thomas.junk@intevation.de>
parents:
4984
diff
changeset
|
111 }, |
2310
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2309
diff
changeset
|
112 initialLoad: (state, initialLoad) => { |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2309
diff
changeset
|
113 state.initialLoad = initialLoad; |
92b21df288e2
client: use user specific extent only on initial load
Markus Kottlaender <markus@intevation.de>
parents:
2309
diff
changeset
|
114 }, |
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
|
115 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
|
116 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
|
117 }, |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
118 addOpenLayersMap: (state, map) => { |
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
119 state.openLayersMaps.push(map); |
1112
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
120 }, |
3052
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
121 removeOpenLayersMap: (state, map) => { |
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
122 let index = state.openLayersMaps.findIndex( |
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
123 m => m.getTarget() === map.getTarget() |
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
124 ); |
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
125 if (index !== -1) { |
3071
53082e5a198a
client: maps: fixed removing a map, added missing second param for splice
Markus Kottlaender <markus@intevation.de>
parents:
3069
diff
changeset
|
126 state.openLayersMaps.splice(index, 1); |
3052
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
127 } |
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
128 }, |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3081
diff
changeset
|
129 syncedMaps: (state, ids) => { |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3081
diff
changeset
|
130 state.syncedMaps = ids; |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3081
diff
changeset
|
131 }, |
3063
333aff79197d
client: maps: all map's views are now synced
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
132 syncedView: (state, view) => { |
333aff79197d
client: maps: all map's views are now synced
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
133 state.syncedView = view; |
333aff79197d
client: maps: all map's views are now synced
Markus Kottlaender <markus@intevation.de>
parents:
3062
diff
changeset
|
134 }, |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
135 mapPopup: (state, popup) => { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
136 state.mapPopup = popup; |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
137 }, |
3261
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
138 mapPopupEnabled: (state, enabled) => { |
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
139 state.mapPopupEnabled = enabled; |
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
140 }, |
1112
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
141 setIdentifiedFeatures: (state, identifiedFeatures) => { |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
142 state.identifiedFeatures = identifiedFeatures; |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
143 }, |
3029
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3006
diff
changeset
|
144 addIdentifiedFeatures: (state, identifiedFeatures) => { |
3031 | 145 state.identifiedFeatures = state.identifiedFeatures.concat( |
146 identifiedFeatures | |
147 ); | |
3029
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3006
diff
changeset
|
148 }, |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
149 identifiedCoordinates: (state, coordinates) => { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
150 state.identifiedCoordinates = coordinates; |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
151 }, |
1112
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
152 setCurrentMeasurement: (state, measurement) => { |
2c3d32322126
moved identifystore properties to mapstore
Markus Kottlaender <markus@intevation.de>
parents:
1099
diff
changeset
|
153 state.currentMeasurement = measurement; |
1115
1b160eda22cf
moved drawMode to map store
Markus Kottlaender <markus@intevation.de>
parents:
1114
diff
changeset
|
154 }, |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
155 lineToolEnabled: (state, enabled) => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
156 state.lineToolEnabled = enabled; |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
157 state.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
158 let tool = m |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
159 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
160 .getArray() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
161 .find(i => i.get("id") === "linetool"); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
162 if (tool) { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
163 tool.setActive(enabled); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
164 } |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
165 }); |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
166 }, |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
167 polygonToolEnabled: (state, enabled) => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
168 state.polygonToolEnabled = enabled; |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
169 state.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
170 let tool = m |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
171 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
172 .getArray() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
173 .find(i => i.get("id") === "polygontool"); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
174 if (tool) { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
175 tool.setActive(enabled); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
176 } |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
177 }); |
1140
2e06bc53b002
separating line/polygon/cut tools in UI
Markus Kottlaender <markus@intevation.de>
parents:
1122
diff
changeset
|
178 }, |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
179 cutToolEnabled: (state, enabled) => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
180 state.cutToolEnabled = enabled; |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
181 state.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
182 let tool = m |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
183 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
184 .getArray() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
185 .find(i => i.get("id") === "cuttool"); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
186 if (tool) { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
187 tool.setActive(enabled); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
188 } |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
189 }); |
1158
da75faa8043f
added central moveMap method to pan and zoom the map on certain events
Markus Kottlaender <markus@intevation.de>
parents:
1144
diff
changeset
|
190 }, |
1927
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
191 isolinesLegendImgDataURL: (state, isolinesLegendImgDataURL) => { |
5a37ee321651
client: make isolines legend graphic internally availableo
Bernhard Reiter <bernhard@intevation.de>
parents:
1879
diff
changeset
|
192 state.isolinesLegendImgDataURL = isolinesLegendImgDataURL; |
2932
173ce013a021
layers: difference layer now contains legend
Thomas Junk <thomas.junk@intevation.de>
parents:
2910
diff
changeset
|
193 }, |
173ce013a021
layers: difference layer now contains legend
Thomas Junk <thomas.junk@intevation.de>
parents:
2910
diff
changeset
|
194 differencesLegendImgDataURL: (state, differencesLegendImgDataURL) => { |
173ce013a021
layers: difference layer now contains legend
Thomas Junk <thomas.junk@intevation.de>
parents:
2910
diff
changeset
|
195 state.differencesLegendImgDataURL = differencesLegendImgDataURL; |
1144 | 196 } |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
197 }, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
198 actions: { |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
199 openLayersMap({ state, commit, dispatch }, map) { |
3006
44493664d40e
client: refactored layers config
Markus Kottlaender <markus@intevation.de>
parents:
2997
diff
changeset
|
200 const drawVectorSrc = map.getLayer("DRAWTOOL").getSource(); |
44493664d40e
client: refactored layers config
Markus Kottlaender <markus@intevation.de>
parents:
2997
diff
changeset
|
201 const cutVectorSrc = map.getLayer("CUTTOOL").getSource(); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
202 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
203 // init line tool |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
204 const lineTool = new Draw({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
205 source: drawVectorSrc, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
206 type: "LineString", |
3259
985bc5009115
client: prevent mutual intefering between draw tools and identify tool on openlayers api level
Markus Kottlaender <markus@intevation.de>
parents:
3256
diff
changeset
|
207 maxPoints: 2, |
985bc5009115
client: prevent mutual intefering between draw tools and identify tool on openlayers api level
Markus Kottlaender <markus@intevation.de>
parents:
3256
diff
changeset
|
208 stopClick: true |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
209 }); |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
210 lineTool.set("id", "linetool"); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
211 lineTool.setActive(false); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
212 lineTool.on("drawstart", () => { |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
213 state.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
214 m.getLayer("DRAWTOOL") |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
215 .getSource() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
216 .clear(); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
217 }); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
218 commit("setCurrentMeasurement", null); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
219 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
220 lineTool.on("drawend", event => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
221 commit("setCurrentMeasurement", { |
1524
a0a16577261a
Translation: mark some strings for translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1438
diff
changeset
|
222 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
|
223 unitSymbol: "m", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
224 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
|
225 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
226 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
|
227 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
228 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
229 // init polygon tool |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
230 const polygonTool = new Draw({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
231 source: drawVectorSrc, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
232 type: "Polygon", |
3259
985bc5009115
client: prevent mutual intefering between draw tools and identify tool on openlayers api level
Markus Kottlaender <markus@intevation.de>
parents:
3256
diff
changeset
|
233 maxPoints: 50, |
985bc5009115
client: prevent mutual intefering between draw tools and identify tool on openlayers api level
Markus Kottlaender <markus@intevation.de>
parents:
3256
diff
changeset
|
234 stopClick: true |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
235 }); |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
236 polygonTool.set("id", "polygontool"); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
237 polygonTool.setActive(false); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
238 polygonTool.on("drawstart", () => { |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
239 state.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
240 m.getLayer("DRAWTOOL") |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
241 .getSource() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
242 .clear(); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
243 }); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
244 commit("setCurrentMeasurement", null); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
245 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
246 polygonTool.on("drawend", event => { |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
247 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
|
248 commit("setCurrentMeasurement", { |
1524
a0a16577261a
Translation: mark some strings for translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1438
diff
changeset
|
249 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
|
250 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
|
251 value: |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
252 areaSize > 100000 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
253 ? 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
|
254 : Math.round(areaSize) |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
255 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
256 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
|
257 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
258 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
259 // init cut tool |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
260 const cutTool = new Draw({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
261 source: cutVectorSrc, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
262 type: "LineString", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
263 maxPoints: 2, |
3259
985bc5009115
client: prevent mutual intefering between draw tools and identify tool on openlayers api level
Markus Kottlaender <markus@intevation.de>
parents:
3256
diff
changeset
|
264 stopClick: true, |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
265 style: new Style({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
266 stroke: new Stroke({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
267 color: "#444", |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
268 width: 2, |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
269 lineDash: [7, 7] |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
270 }), |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
271 image: new Circle({ |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
272 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
|
273 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
|
274 radius: 6 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
275 }) |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
276 }) |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
277 }); |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
278 cutTool.set("id", "cuttool"); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
279 cutTool.setActive(false); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
280 cutTool.on("drawstart", () => { |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
281 state.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
282 m.getLayer("CUTTOOL") |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
283 .getSource() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
284 .clear(); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
285 }); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
286 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
287 cutTool.on("drawend", event => { |
1395
210e9f16f8a0
delete cross profiles from localstorage
Markus Kottlaender <markus@intevation.de>
parents:
1363
diff
changeset
|
288 commit("fairwayprofile/selectedCut", null, { root: true }); |
3069
766384d0ed7a
client: identify tool: removed distinct enable flag, identify is enabled as long as no other tools are active
Markus Kottlaender <markus@intevation.de>
parents:
3063
diff
changeset
|
289 dispatch("fairwayprofile/cut", event.feature, { root: true }); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
290 }); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
291 |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
292 map.addInteraction(lineTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
293 map.addInteraction(cutTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
294 map.addInteraction(polygonTool); |
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
295 |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
296 // If there are multiple maps and you enable one of the draw tools, when |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
297 // moving the mouse to another map, the cursor for the draw tool stays |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
298 // visible in the first map, right next to the edge where the cursor left |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
299 // the map. So here we disable all draw layers except the ones in the map |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
300 // that the user currently hovering with the mouse. |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
301 map.getTargetElement().addEventListener("mouseenter", () => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
302 if ( |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
303 state.lineToolEnabled || |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
304 state.polygonToolEnabled || |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
305 state.cutToolEnabled |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
306 ) { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
307 state.openLayersMaps.forEach(m => { |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
308 let lineTool = m |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
309 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
310 .getArray() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
311 .find(i => i.get("id") === "linetool"); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
312 let polygonTool = m |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
313 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
314 .getArray() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
315 .find(i => i.get("id") === "polygontool"); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
316 let cutTool = m |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
317 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
318 .getArray() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
319 .find(i => i.get("id") === "cuttool"); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
320 if (lineTool) lineTool.setActive(false); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
321 if (polygonTool) polygonTool.setActive(false); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
322 if (cutTool) cutTool.setActive(false); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
323 }); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
324 let lineTool = map |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
325 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
326 .getArray() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
327 .find(i => i.get("id") === "linetool"); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
328 let polygonTool = map |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
329 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
330 .getArray() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
331 .find(i => i.get("id") === "polygontool"); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
332 let cutTool = map |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
333 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
334 .getArray() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
335 .find(i => i.get("id") === "cuttool"); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
336 if (lineTool && state.lineToolEnabled) lineTool.setActive(true); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
337 if (polygonTool && state.polygonToolEnabled) |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
338 polygonTool.setActive(true); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
339 if (cutTool && state.cutToolEnabled) cutTool.setActive(true); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
340 } |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
341 }); |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3054
diff
changeset
|
342 |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
343 commit("addOpenLayersMap", map); |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
344 }, |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
345 initIdentifyTool({ state, rootState, commit, dispatch }, map) { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
346 map.on(["singleclick", "dblclick"], event => { |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
347 commit( |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
348 "identifiedCoordinates", |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
349 toLonLat(event.coordinate, map.getView().getProjection()) |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
350 ); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
351 state.mapPopup.setPosition(undefined); |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
352 commit("setIdentifiedFeatures", []); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
353 // checking our WFS layers |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
354 var features = map.getFeaturesAtPixel(event.pixel, { hitTolerance: 7 }); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
355 if (features) { |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
356 let all = []; |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
357 let bottlenecks = []; |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
358 let gauges = []; |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
359 let stretches = []; |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
360 let sections = []; |
1435
7fa030127b05
fixed panning problem
Markus Kottlaender <markus@intevation.de>
parents:
1395
diff
changeset
|
361 |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
362 for (let feature of features) { |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
363 // avoid identifying the same feature twice |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
364 if (all.findIndex(f => f.getId() === feature.getId()) === -1) |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
365 all.push(feature); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
366 |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
367 let id = feature.getId(); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
368 // RegExp.prototype.test() works with number, str and undefined |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
369 // get selected bottleneck |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
370 if (/^bottlenecks/.test(id)) bottlenecks.push(feature); |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
371 // get selected gauge |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
372 if (/^gauges/.test(id)) gauges.push(feature); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
373 // get selected stretch |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
374 if (/^stretches/.test(id)) stretches.push(feature); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
375 // get selected section |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
376 if (/^sections/.test(id)) sections.push(feature); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
377 } |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
378 |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
379 commit("setIdentifiedFeatures", all); |
1437
1cd1549aab47
fixed panning problem when drawing cross cuts
Markus Kottlaender <markus@intevation.de>
parents:
1435
diff
changeset
|
380 |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
381 // Decide whether we open a related dialog immediately or show the |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
382 // popup with possible options first. |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
383 // The following cases require a manual decision via the popup because |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
384 // the targeted feature is not clear. |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
385 if ( |
3261
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
386 (bottlenecks.length || |
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
387 gauges.length > 1 || |
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
388 stretches.length > 1 || |
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
389 sections.length > 1 || |
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
390 (sections.length && stretches.length) || |
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
391 (gauges.length && sections.length) || |
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
392 (gauges.length && stretches.length)) && |
916d4c898f08
client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents:
3259
diff
changeset
|
393 state.mapPopupEnabled |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
394 ) { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
395 state.mapPopup.setMap(map); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
396 state.mapPopup.setPosition(event.coordinate); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
397 } |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
398 // The following scenarios lead to a distinct action without popup. |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
399 if ( |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
400 gauges.length === 1 && |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
401 !bottlenecks.length && |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
402 !sections.length && |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
403 !stretches.length |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
404 ) { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
405 commit("application/showGauges", true, { root: true }); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
406 dispatch("gauges/selectedGaugeISRS", gauges[0].get("isrs_code"), { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
407 root: true |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
408 }); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
409 } |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
410 if ( |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
411 stretches.length === 1 && |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
412 !sections.length && |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
413 !bottlenecks.length && |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
414 !gauges.length |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
415 ) { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
416 if (rootState.imports.selectedStretchId === stretches[0].getId()) { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
417 commit("imports/selectedStretchId", null, { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
418 root: true |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
419 }); |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
420 } else { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
421 commit("imports/selectedStretchId", stretches[0].getId(), { |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
422 root: true |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
423 }); |
3313
b01c2f474770
client: identify: changed order of state mutations
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
424 commit("fairwayavailability/type", "stretches", { root: true }); |
b01c2f474770
client: identify: changed order of state mutations
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
425 commit("application/showFairwayDepth", true, { root: true }); |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
426 dispatch("moveToFeauture", { feature: stretches[0], zoom: 17 }); |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
427 } |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
428 } |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
429 if ( |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
430 sections.length === 1 && |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
431 !stretches.length && |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
432 !bottlenecks.length && |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
433 !gauges.length |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
434 ) { |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
435 if (rootState.imports.selectedSectionId === sections[0].getId()) { |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
436 commit("imports/selectedSectionId", null, { |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
437 root: true |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
438 }); |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
439 } else { |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
440 commit("imports/selectedSectionId", sections[0].getId(), { |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
441 root: true |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
442 }); |
3313
b01c2f474770
client: identify: changed order of state mutations
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
443 commit("fairwayavailability/type", "sections", { root: true }); |
b01c2f474770
client: identify: changed order of state mutations
Markus Kottlaender <markus@intevation.de>
parents:
3309
diff
changeset
|
444 commit("application/showFairwayDepth", true, { root: true }); |
3309
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
445 dispatch("moveToFeauture", { feature: sections[0], zoom: 17 }); |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
446 } |
80037790032d
client: fully implemented sections
Markus Kottlaender <markus@intevation.de>
parents:
3269
diff
changeset
|
447 } |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
448 } |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
449 |
3256
48801e13ef18
client: identify: made identification of image layers work with current map resolution
Markus Kottlaender <markus@intevation.de>
parents:
3207
diff
changeset
|
450 let currentResolution = map.getView().getResolution(); |
48801e13ef18
client: identify: made identification of image layers work with current map resolution
Markus Kottlaender <markus@intevation.de>
parents:
3207
diff
changeset
|
451 |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
452 var waterwayAxisSource = map.getLayer("WATERWAYAXIS").getSource(); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
453 var waxisUrl = waterwayAxisSource.getGetFeatureInfoUrl( |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
454 event.coordinate, |
3256
48801e13ef18
client: identify: made identification of image layers work with current map resolution
Markus Kottlaender <markus@intevation.de>
parents:
3207
diff
changeset
|
455 currentResolution /* resolution */, |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
456 "EPSG:3857", |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
457 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
458 { INFO_FORMAT: "application/json" } |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
459 ); |
3047
e0b77d7463e7
Changed Waterway axis and area layer to WMS.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3044
diff
changeset
|
460 |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
461 if (waxisUrl) { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
462 // cannot directly query here because of SOP |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
463 HTTP.get(waxisUrl, { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
464 headers: { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
465 "X-Gemma-Auth": localStorage.getItem("token") |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
466 } |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
467 }).then(response => { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
468 let features = response.data.features.map(f => { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
469 let feat = new Feature({ |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
470 geometry: new Point(f.geometry.coordinates) |
3047
e0b77d7463e7
Changed Waterway axis and area layer to WMS.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3044
diff
changeset
|
471 }); |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
472 feat.setId(f.id); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
473 feat.setProperties(f.properties); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
474 return feat; |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
475 }); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
476 commit("addIdentifiedFeatures", features); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
477 }); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
478 } |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
479 var waterwayAreaSource = map.getLayer("WATERWAYAREA").getSource(); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
480 var wareaUrl = waterwayAreaSource.getGetFeatureInfoUrl( |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
481 event.coordinate, |
3256
48801e13ef18
client: identify: made identification of image layers work with current map resolution
Markus Kottlaender <markus@intevation.de>
parents:
3207
diff
changeset
|
482 currentResolution /* resolution */, |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
483 "EPSG:3857", |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
484 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
485 { INFO_FORMAT: "application/json" } |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
486 ); |
3047
e0b77d7463e7
Changed Waterway axis and area layer to WMS.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3044
diff
changeset
|
487 |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
488 if (wareaUrl) { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
489 HTTP.get(wareaUrl, { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
490 headers: { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
491 "X-Gemma-Auth": localStorage.getItem("token") |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
492 } |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
493 }).then(response => { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
494 let features = response.data.features.map(f => { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
495 let feat = new Feature({ |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
496 geometry: new Point(f.geometry.coordinates) |
3047
e0b77d7463e7
Changed Waterway axis and area layer to WMS.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3044
diff
changeset
|
497 }); |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
498 feat.setId(f.id); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
499 feat.setProperties(f.properties); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
500 return feat; |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
501 }); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
502 commit("addIdentifiedFeatures", features); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
503 }); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
504 } |
3081
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
505 var dmSource = map.getLayer("DISTANCEMARKS").getSource(); |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
506 var dmUrl = dmSource.getGetFeatureInfoUrl( |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
507 event.coordinate, |
3256
48801e13ef18
client: identify: made identification of image layers work with current map resolution
Markus Kottlaender <markus@intevation.de>
parents:
3207
diff
changeset
|
508 currentResolution /* resolution */, |
3081
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
509 "EPSG:3857", |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
510 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
511 { INFO_FORMAT: "application/json" } |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
512 ); |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
513 |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
514 if (dmUrl) { |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
515 HTTP.get(dmUrl + "&BUFFER=5", { |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
516 headers: { |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
517 "X-Gemma-Auth": localStorage.getItem("token") |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
518 } |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
519 }).then(response => { |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
520 let features = response.data.features.map(f => { |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
521 let feat = new Feature({ |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
522 geometry: new Point(f.geometry.coordinates) |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
523 }); |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
524 feat.setId(f.id); |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
525 feat.setProperties(f.properties); |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
526 return feat; |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
527 }); |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
528 commit("addIdentifiedFeatures", features); |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
529 }); |
9107c959bb3b
client: Changed distance marks ashore to WMS layer.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3079
diff
changeset
|
530 } |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
531 var dmaSource = map.getLayer("DISTANCEMARKSAXIS").getSource(); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
532 var dmaUrl = dmaSource.getGetFeatureInfoUrl( |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
533 event.coordinate, |
3256
48801e13ef18
client: identify: made identification of image layers work with current map resolution
Markus Kottlaender <markus@intevation.de>
parents:
3207
diff
changeset
|
534 currentResolution /* resolution */, |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
535 "EPSG:3857", |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
536 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
537 { INFO_FORMAT: "application/json" } |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
538 ); |
3029
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3006
diff
changeset
|
539 |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
540 if (dmaUrl) { |
3078
71129566acdf
client: Increased click radius for distance marks feature info.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3071
diff
changeset
|
541 HTTP.get(dmaUrl + "&BUFFER=5", { |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
542 headers: { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
543 "X-Gemma-Auth": localStorage.getItem("token") |
3029
81c2e561fe03
Use distance marks an axis via WMS. Added legend and featureinfo.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3006
diff
changeset
|
544 } |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
545 }).then(response => { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
546 let features = response.data.features.map(f => { |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
547 let feat = new Feature({ |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
548 geometry: new Point(f.geometry.coordinates) |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
549 }); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
550 feat.setId(f.id); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
551 feat.setProperties(f.properties); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
552 return feat; |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
553 }); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
554 commit("addIdentifiedFeatures", features); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
555 }); |
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
556 } |
4688
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
557 var srSource = map.getLayer("BOTTLENECKISOLINE").getSource(); |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
558 var srUrl = srSource.getGetFeatureInfoUrl( |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
559 event.coordinate, |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
560 currentResolution /* resolution */, |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
561 "EPSG:3857", |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
562 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
563 { INFO_FORMAT: "application/json" } |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
564 ); |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
565 |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
566 if (srUrl) { |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
567 HTTP.get(srUrl + "&BUFFER=5", { |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
568 headers: { |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
569 "X-Gemma-Auth": localStorage.getItem("token") |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
570 } |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
571 }).then(response => { |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
572 let features = response.data.features.map(f => { |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
573 let feat = new Feature({ |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
574 geometry: new Point(f.geometry.coordinates) |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
575 }); |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
576 feat.setId(f.id); |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
577 feat.setProperties(f.properties); |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
578 return feat; |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
579 }); |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
580 commit("addIdentifiedFeatures", features); |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
581 }); |
ad271887fd8d
Added FeatureInfo for sounding results including surtyp attribute.
Raimund Renkert <raimund@renkert.org>
parents:
4459
diff
changeset
|
582 } |
4984
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
583 |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
584 var fmSource = map.getLayer("FAIRWAYMARKS").getSource(); |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
585 var fmURL = fmSource.getGetFeatureInfoUrl( |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
586 event.coordinate, |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
587 currentResolution, |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
588 "EPSG:3857", |
5077
c9354fcf6050
add TIME-Filter to layer and GetFeatureInfo
Thomas Junk <thomas.junk@intevation.de>
parents:
5075
diff
changeset
|
589 { |
c9354fcf6050
add TIME-Filter to layer and GetFeatureInfo
Thomas Junk <thomas.junk@intevation.de>
parents:
5075
diff
changeset
|
590 INFO_FORMAT: "application/json", |
c9354fcf6050
add TIME-Filter to layer and GetFeatureInfo
Thomas Junk <thomas.junk@intevation.de>
parents:
5075
diff
changeset
|
591 TIME: rootState.application.currentVisibleTime.toISOString() |
c9354fcf6050
add TIME-Filter to layer and GetFeatureInfo
Thomas Junk <thomas.junk@intevation.de>
parents:
5075
diff
changeset
|
592 } |
4984
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
593 ); |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
594 if (fmSource) { |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
595 HTTP.get(fmURL, { |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
596 headers: { |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
597 "X-Gemma-Auth": localStorage.getItem("token") |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
598 } |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
599 }).then(response => { |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
600 let features = response.data.features.map(f => { |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
601 let feat = new Feature({ |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
602 geometry: new Point(f.geometry.coordinates) |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
603 }); |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
604 feat.setId(f.id); |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
605 feat.setProperties(f.properties); |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
606 return feat; |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
607 }); |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
608 commit("addIdentifiedFeatures", features); |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
609 }); |
9d57c5765474
add GetFeatureInfo call to FM-layer
Thomas Junk <thomas.junk@intevation.de>
parents:
4865
diff
changeset
|
610 } |
3051
051a3f446ac2
client: made identify tool work with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3047
diff
changeset
|
611 }); |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
612 }, |
3409
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
613 refreshLayers({ state }) { |
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
614 state.openLayersMaps.forEach(map => { |
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
615 let layers = map.getLayers().getArray(); |
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
616 for (let i = 0; i < layers.length; i++) { |
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
617 let layer = layers[i]; |
3851
45eab8e9b580
client: layer refresh button refreshes now all layers, not just vector layers
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
618 if (layer instanceof VectorLayer) { |
3409
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
619 layer.getSource().clear(true); |
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
620 } |
3851
45eab8e9b580
client: layer refresh button refreshes now all layers, not just vector layers
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
621 layer.getSource().refresh(); |
3409
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
622 } |
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
623 }); |
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3313
diff
changeset
|
624 }, |
5088
99ece290b9a9
client: Use proper time value in refresh layers requests
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5083
diff
changeset
|
625 refreshTimebasedLayers({ state, rootState }) { |
5083
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
626 const layers = [ |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
627 "BOTTLENECKS", |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
628 "FAIRWAYDIMENSIONSLOS1", |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
629 "FAIRWAYDIMENSIONSLOS2", |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
630 "FAIRWAYDIMENSIONSLOS3", |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
631 "WATERWAYAXIS", |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
632 "FAIRWAYMARKS" |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
633 ]; |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
634 state.openLayersMaps.forEach(map => { |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
635 for (let i = 0; i < layers.length; i++) { |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
636 let layer = map.getLayer(layers[i]); |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
637 if (layer instanceof VectorLayer) { |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
638 layer.getSource().clear(true); |
5088
99ece290b9a9
client: Use proper time value in refresh layers requests
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5083
diff
changeset
|
639 } else { |
99ece290b9a9
client: Use proper time value in refresh layers requests
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5083
diff
changeset
|
640 // Refresh layers with updated TIME value |
99ece290b9a9
client: Use proper time value in refresh layers requests
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5083
diff
changeset
|
641 layer.getSource().updateParams({ |
99ece290b9a9
client: Use proper time value in refresh layers requests
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5083
diff
changeset
|
642 TIME: rootState.application.refreshLayersTime.toISOString() |
99ece290b9a9
client: Use proper time value in refresh layers requests
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5083
diff
changeset
|
643 }); |
5083
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
644 } |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
645 layer.getSource().refresh(); |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
646 } |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
647 }); |
5ec30f63fd58
client: reload only the relevant layers with changed value on time-slider
Fadi Abbud <fadi.abbud@intevation.de>
parents:
5079
diff
changeset
|
648 }, |
3181
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
649 moveToBoundingBox( |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
650 { state }, |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
651 { boundingBox, zoom, preventZoomOut, duration } |
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
652 ) { |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
653 const extent = transformExtent(boundingBox, "EPSG:4326", "EPSG:3857"); |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
654 const currentZoom = state.syncedView.getZoom(); |
3054
1ef2f4179d30
client: map store: merged/renamed method(s)
Markus Kottlaender <markus@intevation.de>
parents:
3053
diff
changeset
|
655 zoom = zoom || currentZoom; |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
656 state.syncedView.fit(extent, { |
3054
1ef2f4179d30
client: map store: merged/renamed method(s)
Markus Kottlaender <markus@intevation.de>
parents:
3053
diff
changeset
|
657 maxZoom: preventZoomOut ? Math.max(zoom, currentZoom) : zoom, |
3181
c122a064fd5e
client: map: fixed loading animation for layers
Markus Kottlaender <markus@intevation.de>
parents:
3177
diff
changeset
|
658 duration: duration || 700 |
3054
1ef2f4179d30
client: map store: merged/renamed method(s)
Markus Kottlaender <markus@intevation.de>
parents:
3053
diff
changeset
|
659 }); |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
660 }, |
3054
1ef2f4179d30
client: map store: merged/renamed method(s)
Markus Kottlaender <markus@intevation.de>
parents:
3053
diff
changeset
|
661 moveToFeauture({ dispatch }, { feature, zoom, preventZoomOut }) { |
3204
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
662 const boundingBox = feature.hasOwnProperty("geometry") |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
663 ? bbox(feature.geometry) |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
664 : feature |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
665 .getGeometry() |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
666 .clone() |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
667 .transform("EPSG:3857", "EPSG:4326") |
1253fe15e3e3
client: identify: implemented popup when clicking the map and the intention is not clear...
Markus Kottlaender <markus@intevation.de>
parents:
3181
diff
changeset
|
668 .getExtent(); |
3053
61e4feb04a35
client: avoid code duplication
Markus Kottlaender <markus@intevation.de>
parents:
3052
diff
changeset
|
669 dispatch("moveToBoundingBox", { boundingBox, zoom, preventZoomOut }); |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
670 }, |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
671 moveMap({ state }, { coordinates, zoom, preventZoomOut }) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
672 const currentZoom = state.syncedView.getZoom(); |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
673 zoom = zoom || currentZoom; |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
674 state.syncedView.animate({ |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
675 zoom: preventZoomOut ? Math.max(zoom, currentZoom) : zoom, |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3078
diff
changeset
|
676 center: fromLonLat(coordinates, state.syncedView.getProjection()), |
3044
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
677 duration: 700 |
c71373594719
client: map: prepared store to hold multiple map objects
Markus Kottlaender <markus@intevation.de>
parents:
3043
diff
changeset
|
678 }); |
1296
99c039e86624
replaced manual store cleanup on logout with central store reset
Markus Kottlaender <markus@intevation.de>
parents:
1272
diff
changeset
|
679 } |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
680 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
681 }; |