annotate client/src/map/store.js @ 939:a22f66acfd96

client: move layer distance marks axis to be drawn on top * Move distance marks on the axis to be drawn last and thus on top of the contour lines to be more visible.
author Bernhard Reiter <bernhard@intevation.de>
date Tue, 09 Oct 2018 00:37:23 +0200
parents fe923c8ef08f
children 2025074ad835
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 //import { HTTP } from "../lib/http";
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 import TileWMS from "ol/source/TileWMS.js";
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
4 import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer.js";
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
5 import OSM from "ol/source/OSM";
691
d643ff60f607 Client: improve style of waterway axis.
Bernhard Reiter <bernhard@intevation.de>
parents: 688
diff changeset
6 import { Stroke, Style, Fill, Text, Circle as CircleStyle } from "ol/style.js";
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 import VectorSource from "ol/source/Vector.js";
701
8149772c62d6 client: add bbox loading strategy to riverkilometre
Bernhard Reiter <bernhard@intevation.de>
parents: 700
diff changeset
8 import { bbox as bboxStrategy } from "ol/loadingstrategy";
852
a3b2626cef49 Client: Load WMS layer with sounding result contour lines.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 842
diff changeset
9 import { HTTP } from "../application/lib/http";
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 const MapStore = {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
12 namespaced: true,
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
13 state: {
783
ab9604a46075 client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents: 782
diff changeset
14 openLayersMap: null,
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 layers: [
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 name: "Open Streetmap",
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 data: new TileLayer({
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 source: new OSM()
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 }),
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 isVisible: true
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
22 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
23 {
625
4acf60d1bbb4 clients: shorten ECDIS layer name.
Bernhard Reiter <bernhard@intevation.de>
parents: 620
diff changeset
24 name: "Inland ECDIS chart Danube",
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
25 data: new TileLayer({
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 source: new TileWMS({
700
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
27 preload: 1,
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
28 url: "https://demo.d4d-portal.info/wms",
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
29 params: { LAYERS: "d4d", VERSION: "1.1.1", TILED: true }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
30 })
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
31 }),
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
32 isVisible: true
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
33 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
34 {
716
22159077b564 client: add step to intersect with fairways
Bernhard Reiter <bernhard@intevation.de>
parents: 702
diff changeset
35 name: "Fairway Dimensions",
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
36 data: new VectorLayer({
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
37 source: new VectorSource(),
659
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
38 style: function(feature) {
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
39 return [
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
40 new Style({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
41 stroke: new Stroke({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
42 color: "rgba(0, 0, 255, 1.0)",
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
43 width: 2
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
44 })
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
45 }),
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
46 new Style({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
47 text: new Text({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
48 font: 'bold 12px "Open Sans", "sans-serif"',
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
49 placement: "line",
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
50 fill: new Fill({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
51 color: "black"
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
52 }),
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
53 text: "LOS: " + feature.get("level_of_service").toString()
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
54 //, zIndex: 10
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
55 })
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
56 })
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
57 ];
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
58 }
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
59 }),
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
60 isVisible: true
620
ef00684e021f client: add showing special buoys
Bernhard Reiter <bernhard@intevation.de>
parents: 618
diff changeset
61 },
ef00684e021f client: add showing special buoys
Bernhard Reiter <bernhard@intevation.de>
parents: 618
diff changeset
62 {
747
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
63 name: "Waterway Area, named",
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
64 data: new VectorLayer({
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
65 source: new VectorSource({
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
66 strategy: bboxStrategy
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
67 }),
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
68 style: new Style({
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
69 stroke: new Stroke({
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
70 color: "rgba(0, 132, 0, 1)",
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
71 width: 2
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
72 })
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
73 })
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
74 }),
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
75 isVisible: false
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
76 },
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
77 {
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
78 name: "Waterway Area",
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
79 data: new VectorLayer({
702
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
80 source: new VectorSource({
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
81 strategy: bboxStrategy
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
82 }),
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
83 style: new Style({
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
84 stroke: new Stroke({
688
89b497d0ee0f client: change waterway area style to dark green
Bernhard Reiter <bernhard@intevation.de>
parents: 663
diff changeset
85 color: "rgba(0, 102, 0, 1)",
89b497d0ee0f client: change waterway area style to dark green
Bernhard Reiter <bernhard@intevation.de>
parents: 663
diff changeset
86 width: 2
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
87 })
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
88 })
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
89 }),
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
90 isVisible: true
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
91 },
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
92 {
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
93 name: "Waterway Axis",
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
94 data: new VectorLayer({
733
e57955c1996f client: improve code structure
Bernhard Reiter <bernhard@intevation.de>
parents: 716
diff changeset
95 source: new VectorSource({
e57955c1996f client: improve code structure
Bernhard Reiter <bernhard@intevation.de>
parents: 716
diff changeset
96 strategy: bboxStrategy
e57955c1996f client: improve code structure
Bernhard Reiter <bernhard@intevation.de>
parents: 716
diff changeset
97 }),
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
98 style: new Style({
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
99 stroke: new Stroke({
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
100 color: "rgba(0, 0, 255, .5)",
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
101 lineDash: [5, 5],
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
102 width: 2
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
103 })
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
104 })
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
105 }),
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
106 isVisible: true
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
107 },
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
108 {
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
109 name: "Distance marks",
804
21609ba97357 client: improve legendelements for layerselection
Bernhard Reiter <bernhard@intevation.de>
parents: 793
diff changeset
110 forLegendStyle: { point: true, resolution: 8 },
620
ef00684e021f client: add showing special buoys
Bernhard Reiter <bernhard@intevation.de>
parents: 618
diff changeset
111 data: new VectorLayer({
702
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
112 source: new VectorSource({
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
113 strategy: bboxStrategy
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
114 })
620
ef00684e021f client: add showing special buoys
Bernhard Reiter <bernhard@intevation.de>
parents: 618
diff changeset
115 }),
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
116 isVisible: false
659
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
117 },
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
118 {
790
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
119 name: "Bottlenecks",
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
120 data: new VectorLayer({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
121 source: new VectorSource({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
122 strategy: bboxStrategy
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
123 }),
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
124 style: new Style({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
125 stroke: new Stroke({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
126 color: "rgba(230, 230, 10, .8)",
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
127 width: 4
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
128 }),
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
129 fill: new Fill({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
130 color: "rgba(230, 230, 10, .3)"
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
131 })
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
132 })
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
133 }),
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
134 isVisible: true
935
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
135 },
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
136 {
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
137 name: "Bottleneck isolines",
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
138 data: new TileLayer({
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
139 source: new TileWMS({
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
140 preload: 0,
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
141 projection: "EPSG:3857",
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
142 url: window.location.origin + "/api/internal/wms",
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
143 params: {
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
144 LAYERS: "sounding_results_contour_lines_geoserver",
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
145 VERSION: "1.1.1",
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
146 TILED: true
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
147 },
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
148 tileLoadFunction: function(tile, src) {
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
149 // console.log("calling for", tile, src);
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
150 HTTP.get(src, {
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
151 headers: {
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
152 "X-Gemma-Auth": localStorage.getItem("token")
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
153 },
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
154 responseType: "blob"
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
155 }).then(response => {
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
156 tile.getImage().src = URL.createObjectURL(response.data);
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
157 });
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
158 } // TODO tile.setState(TileState.ERROR);
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
159 })
430d52c2f6ef client: move layer isolines to be drawn at the top
Bernhard Reiter <bernhard@intevation.de>
parents: 865
diff changeset
160 }),
938
fe923c8ef08f client: add static legend image to contour_lines
Bernhard Reiter <bernhard@intevation.de>
parents: 935
diff changeset
161 isVisible: false
939
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
162 },
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
163 {
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
164 name: "Distance marks, Axis",
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
165 forLegendStyle: { point: true, resolution: 8 },
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
166 data: new VectorLayer({
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
167 source: new VectorSource({
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
168 strategy: bboxStrategy
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
169 }),
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
170 style: function(feature, resolution) {
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
171 if (resolution < 10) {
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
172 var s = new Style({
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
173 image: new CircleStyle({
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
174 radius: 5,
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
175 fill: new Fill({ color: "rgba(255, 0, 0, 0.1)" }),
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
176 stroke: new Stroke({ color: "blue", width: 1 })
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
177 })
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
178 });
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
179 if (resolution < 6) {
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
180 s.setText(
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
181 new Text({
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
182 offsetY: 12,
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
183 font: '10px "Open Sans", "sans-serif"',
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
184 fill: new Fill({
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
185 color: "black"
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
186 }),
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
187 text: (feature.get("hectometre") / 10).toString()
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
188 })
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
189 );
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
190 }
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
191 return s;
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
192 } else {
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
193 return [];
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
194 }
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
195 }
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
196 }),
a22f66acfd96 client: move layer distance marks axis to be drawn on top
Bernhard Reiter <bernhard@intevation.de>
parents: 938
diff changeset
197 isVisible: true
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
198 }
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents: 754
diff changeset
199 ],
836
0b994949a4a0 client: make Morphtool selection more robust
Bernhard Reiter <bernhard@intevation.de>
parents: 826
diff changeset
200 // note that some identified features may not have an id
0b994949a4a0 client: make Morphtool selection more robust
Bernhard Reiter <bernhard@intevation.de>
parents: 826
diff changeset
201 // especially related to drawing in our own vector layer
793
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 790
diff changeset
202 identifiedFeatures: [],
816
cd79f62794dd client: prepare survey selection
Bernhard Reiter <bernhard@intevation.de>
parents: 804
diff changeset
203 currentMeasurement: null,
cd79f62794dd client: prepare survey selection
Bernhard Reiter <bernhard@intevation.de>
parents: 804
diff changeset
204 selectedMorph: null
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
205 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
206 getters: {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
207 layers: state => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
208 return state.layers;
754
105c421f99b1 refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents: 747
diff changeset
209 },
105c421f99b1 refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents: 747
diff changeset
210 getLayerByName: state => name => {
105c421f99b1 refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents: 747
diff changeset
211 return state.layers.find(layer => layer.name === name);
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
212 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
213 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
214 mutations: {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
215 toggleVisibility: (state, layer) => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
216 state.layers[layer].isVisible = !state.layers[layer].isVisible;
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
217 state.layers[layer].data.setVisible(state.layers[layer].isVisible);
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents: 754
diff changeset
218 },
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents: 754
diff changeset
219 setIdentifiedFeatures: (state, identifiedFeatures) => {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents: 754
diff changeset
220 state.identifiedFeatures = identifiedFeatures;
783
ab9604a46075 client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents: 782
diff changeset
221 },
ab9604a46075 client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents: 782
diff changeset
222 setOpenLayersMap: (state, map) => {
ab9604a46075 client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents: 782
diff changeset
223 state.openLayersMap = map;
793
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 790
diff changeset
224 },
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 790
diff changeset
225 setCurrentMeasurement: (state, measurement) => {
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 790
diff changeset
226 state.currentMeasurement = measurement;
816
cd79f62794dd client: prepare survey selection
Bernhard Reiter <bernhard@intevation.de>
parents: 804
diff changeset
227 },
826
90a601884ff2 client: improve survey selection for Morphtool
Bernhard Reiter <bernhard@intevation.de>
parents: 816
diff changeset
228 setSelectedMorph: (state, selectedMorph) => {
816
cd79f62794dd client: prepare survey selection
Bernhard Reiter <bernhard@intevation.de>
parents: 804
diff changeset
229 state.selectedMorph = selectedMorph;
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
230 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
231 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
232 };
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
233
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
234 export default MapStore;