Mercurial > gemma
annotate client/src/components/map/Map.vue @ 3102:a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
In order to use a configurable OSM provider a url has to be provided
via backend. Currently for POC reasons an irrelevant call to /users is made
after which the OSM-layer is initialized.
ToDo: provide the correct URL for OSM configuration.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 25 Apr 2019 12:48:08 +0200 |
parents | a69a8deb56fe |
children | 19fc84a98479 |
rev | line source |
---|---|
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
2 <div |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
3 :id="'map-' + paneId" |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
4 :class="['map', { nocursor: this.hasActiveInteractions }]" |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
5 /> |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
6 </template> |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
8 <style lang="sass" scoped> |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
9 .map |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
10 width: 100% |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
11 height: 100% |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
12 background-color: #eee |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
13 background-image: linear-gradient(45deg, #e8e8e8 25%, transparent 25%, transparent 75%, #e8e8e8 75%, #e8e8e8), linear-gradient(45deg, #e8e8e8 25%, transparent 25%, transparent 75%, #e8e8e8 75%, #e8e8e8) |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
14 background-size: 20px 20px |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
15 background-position: 0 0, 10px 10px |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
16 &.nocursor |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
17 cursor: none |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 </style> |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 <script> |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
21 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 * without warranty, see README.md and license for details. |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
23 * |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 * SPDX-License-Identifier: AGPL-3.0-or-later |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 * License-Filename: LICENSES/AGPL-3.0.txt |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 * |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 * Copyright (C) 2018, 2019 by via donau |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 * – Österreichische Wasserstraßen-Gesellschaft mbH |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 * Software engineering by Intevation GmbH |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 * |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 * Author(s): |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
32 * * Thomas Junk <thomas.junk@intevation.de> |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
33 * * Bernhard E. Reiter <bernhard.reiter@intevation.de> |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
34 */ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
35 import { HTTP } from "@/lib/http"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
36 import { mapState } from "vuex"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
37 import { Map, View } from "ol"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 import { Stroke, Style, Fill } from "ol/style"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 import { displayError } from "@/lib/errors"; |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
40 import { pane } from "@/lib/mixins"; |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
41 import layers from "@/components/map/layers"; |
3102
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
42 import { Tile as TileLayer } from "ol/layer"; |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
43 import "ol/ol.css"; |
3102
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
44 import OSM from "ol/source/OSM"; |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
45 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
46 /* for the sake of debugging */ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
47 /* eslint-disable no-console */ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
48 export default { |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
49 mixins: [pane], |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 data() { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 return { |
3016
083cd270bdfd
client: splitview: implemented rotation mechanism
Markus Kottlaender <markus@intevation.de>
parents:
3011
diff
changeset
|
52 map: null, |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
53 splitscreen: false |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
54 }; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 }, |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 computed: { |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
57 ...mapState("map", ["initialLoad", "extent", "syncedMaps", "syncedView"]), |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 ...mapState("bottlenecks", ["selectedSurvey"]), |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
59 ...mapState("fairwayprofile", ["additionalSurvey"]), |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
60 ...mapState("application", ["panes", "paneRotate"]), |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
61 ...mapState("imports", ["selectedStretchId"]), |
3021
2e2a271c1026
client: fixed layer factory to actually serve different objects
Markus Kottlaender <markus@intevation.de>
parents:
3016
diff
changeset
|
62 layers() { |
2e2a271c1026
client: fixed layer factory to actually serve different objects
Markus Kottlaender <markus@intevation.de>
parents:
3016
diff
changeset
|
63 return layers(); |
2e2a271c1026
client: fixed layer factory to actually serve different objects
Markus Kottlaender <markus@intevation.de>
parents:
3016
diff
changeset
|
64 }, |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
65 hasActiveInteractions() { |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
66 return ( |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
67 this.map && |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3057
diff
changeset
|
68 this.map |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3057
diff
changeset
|
69 .getInteractions() |
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3057
diff
changeset
|
70 .getArray() |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
71 .filter( |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
72 i => |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
73 ["linetool", "polygontool", "cuttool"].includes(i.get("id")) && |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
74 i.getActive() |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
75 ).length |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
76 ); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
77 } |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
78 }, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
79 watch: { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
80 panes() { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
81 this.$nextTick(() => this.map.updateSize()); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
82 }, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
83 paneRotate() { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
84 this.$nextTick(() => this.map.updateSize()); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
85 }, |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
86 syncedMaps(syncedMaps) { |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
87 if (syncedMaps.includes(this.paneId) || this.paneId === "main") { |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
88 this.map.setView(this.syncedView); |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
89 } else { |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
90 this.map.setView( |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
91 new View({ |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
92 center: [this.extent.lon, this.extent.lat], |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
93 minZoom: 5, // restrict zooming out to ~size of Europe for width 1000px |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
94 zoom: this.extent.zoom, |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
95 projection: "EPSG:3857" |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
96 }) |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
97 ); |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
98 } |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
99 }, |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
100 selectedSurvey(survey) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
101 if (this.paneId === "main") { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
102 if (survey) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
103 this.updateBottleneckFilter(survey.bottleneck_id, survey.date_info); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
104 } else { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
105 this.updateBottleneckFilter("does_not_exist", "1999-10-01"); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
106 } |
3062
87e0422cffa7
client: draw/cut tools work now with multiple maps
Markus Kottlaender <markus@intevation.de>
parents:
3057
diff
changeset
|
107 } |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
108 }, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
109 additionalSurvey(survey) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
110 if (this.paneId === "compare-sounding-results") { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
111 if (survey) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
112 this.updateBottleneckFilter(survey.bottleneck_id, survey.date_info); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
113 } else { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
114 this.updateBottleneckFilter("does_not_exist", "1999-10-01"); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
115 } |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
116 } |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
117 }, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
118 selectedStretchId(id) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
119 this.layers |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
120 .get("STRETCHES") |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
121 .getSource() |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
122 .getFeatures() |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
123 .forEach(f => { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
124 f.set("highlighted", false); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
125 if (id === f.getId()) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
126 f.set("highlighted", true); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
127 } |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
128 }); |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
129 } |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
130 }, |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
131 methods: { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
132 updateBottleneckFilter(bottleneck_id, datestr) { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
133 const exists = bottleneck_id != "does_not_exist"; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
134 |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
135 if (exists) { |
3021
2e2a271c1026
client: fixed layer factory to actually serve different objects
Markus Kottlaender <markus@intevation.de>
parents:
3016
diff
changeset
|
136 this.layers |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
137 .get("BOTTLENECKISOLINE") |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
138 .getSource() |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
139 .updateParams({ |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
140 cql_filter: `date_info='${datestr}' AND bottleneck_id='${bottleneck_id}'` |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
141 }); |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
142 } |
3021
2e2a271c1026
client: fixed layer factory to actually serve different objects
Markus Kottlaender <markus@intevation.de>
parents:
3016
diff
changeset
|
143 this.layers.get("BOTTLENECKISOLINE").setVisible(exists); |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
144 }, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
145 initMap() { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
146 if (!this.syncedView) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
147 this.$store.commit( |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
148 "map/syncedView", |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
149 new View({ |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
150 center: [this.extent.lon, this.extent.lat], |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
151 minZoom: 5, // restrict zooming out to ~size of Europe for width 1000px |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
152 zoom: this.extent.zoom, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
153 projection: "EPSG:3857" |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
154 }) |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
155 ); |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
156 } |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
157 this.map = new Map({ |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
158 layers: this.layers.config, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
159 target: "map-" + this.paneId, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
160 controls: [], |
3086
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
161 view: |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
162 this.syncedMaps.includes(this.paneId) || this.paneId === "main" |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
163 ? this.syncedView |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
164 : new View({ |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
165 center: [this.extent.lon, this.extent.lat], |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
166 minZoom: 5, |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
167 zoom: this.extent.zoom, |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
168 projection: "EPSG:3857" |
a69a8deb56fe
client: added button to sync/unsync maps when comparing sounding results
Markus Kottlaender <markus@intevation.de>
parents:
3079
diff
changeset
|
169 }) |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
170 }); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
171 this.map.getLayer = id => this.layers.get(id); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
172 |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
173 // store map position on every move |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
174 // will be obsolete once we abandoned the separated admin context |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
175 this.map.on("moveend", event => { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
176 const center = event.map.getView().getCenter(); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
177 this.$store.commit("map/extent", { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
178 lat: center[1], |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
179 lon: center[0], |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
180 zoom: event.map.getView().getZoom() |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
181 }); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
182 }); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
183 this.$store.dispatch("map/openLayersMap", this.map); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
184 |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
185 // move to user specific default extent if map loads for the first time |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
186 // checking initialLoad will be obsolete once we abandoned the separated admin context |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
187 if (this.initialLoad) { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
188 this.$store.commit("map/initialLoad", false); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
189 var currentUser = this.$store.state.user.user; |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
190 HTTP.get("/users/" + currentUser, { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
191 headers: { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
192 "X-Gemma-Auth": localStorage.getItem("token"), |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
193 "Content-type": "text/xml; charset=UTF-8" |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
194 } |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
195 }) |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
196 .then(response => { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
197 this.$store.dispatch("map/moveToBoundingBox", { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
198 boundingBox: [ |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
199 response.data.extent.x1, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
200 response.data.extent.y1, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
201 response.data.extent.x2, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
202 response.data.extent.y2 |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
203 ], |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
204 zoom: 17, |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
205 preventZoomOut: true |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
206 }); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
207 }) |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
208 .catch(error => { |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
209 const { status, data } = error.response; |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
210 displayError({ |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
211 title: this.$gettext("Backend Error"), |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
212 message: `${status}: ${data.message || data}` |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
213 }); |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
214 }); |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
215 } |
3079
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
216 |
57255fda7594
client: compare surveys on map
Markus Kottlaender <markus@intevation.de>
parents:
3077
diff
changeset
|
217 this.$store.dispatch("map/initIdentifyTool", this.map); |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
218 } |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
219 }, |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
220 mounted() { |
3102
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
221 // ToDo set path to correct endpoint in order to retrieve an OSM URL |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
222 HTTP.get("/users", { |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
223 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
224 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
225 .then(response => { |
3102
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
226 const { url } = response.data; |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
227 const config = {}; |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
228 if (url) config["url"] = url; |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
229 this.layers.config.unshift( |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
230 new TileLayer({ |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
231 id: "OPENSTREETMAP", |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
232 label: "Open Streetmap", |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
233 visible: true, |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
234 source: new OSM(config) |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
235 }) |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
236 ); |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
237 this.initMap(); |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
238 |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
239 if (this.selectedSurvey && this.paneId === "main") { |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
240 this.updateBottleneckFilter( |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
241 this.selectedSurvey.bottleneck_id, |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
242 this.selectedSurvey.date_info |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
243 ); |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
244 } |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
245 if ( |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
246 this.additionalSurvey && |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
247 this.paneId === "compare-sounding-results" |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
248 ) { |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
249 this.updateBottleneckFilter( |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
250 this.additionalSurvey.bottleneck_id, |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
251 this.additionalSurvey.date_info |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
252 ); |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
253 } |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
254 // load configured bottleneck colors |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
255 HTTP.get("/system/style/Bottlenecks/stroke", { |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
256 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
257 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
258 .then(response => { |
3102
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
259 let btlnStrokeC = response.data.code; |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
260 HTTP.get("/system/style/Bottlenecks/fill", { |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
261 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
262 }) |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
263 .then(response => { |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
264 let btlnFillC = response.data.code; |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
265 var newStyle = new Style({ |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
266 stroke: new Stroke({ |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
267 color: btlnStrokeC, |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
268 width: 4 |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
269 }), |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
270 fill: new Fill({ |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
271 color: btlnFillC |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
272 }) |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
273 }); |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
274 this.layers.get("BOTTLENECKS").setStyle(newStyle); |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
275 }) |
3102
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
276 .catch(error => { |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
277 console.log(error); |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
278 }); |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
279 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
280 .catch(error => { |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
281 console.log(error); |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
282 }); |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
283 }) |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
284 .catch(error => { |
3102
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
285 const { status, data } = error.response; |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
286 displayError({ |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
287 title: "Backend Error", |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
288 message: `${status}: ${data.message || data}` |
a9c7825303b3
layers: Code for provisioning a dynamic URL for OSM etd.
Thomas Junk <thomas.junk@intevation.de>
parents:
3086
diff
changeset
|
289 }); |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
290 }); |
3052
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
291 }, |
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
292 destroyed() { |
01210542e028
client: remove openlayers map objects after removing a map component from the view
Markus Kottlaender <markus@intevation.de>
parents:
3051
diff
changeset
|
293 this.$store.commit("map/removeOpenLayersMap", this.map); |
3011
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
294 } |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
295 }; |
fc8fbea24568
client: moved map component, layer factory and styles to own subdirectory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
296 </script> |