annotate client/src/map/store.js @ 802:327aa4a18a1c

Fairway profile WIP
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 27 Sep 2018 13:36:43 +0200
parents 073394629ec6
children 21609ba97357
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";
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10 const MapStore = {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 namespaced: true,
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
12 state: {
783
ab9604a46075 client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents: 782
diff changeset
13 openLayersMap: null,
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
14 layers: [
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 name: "Open Streetmap",
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 data: new TileLayer({
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 source: new OSM()
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 }),
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 isVisible: true
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
22 {
625
4acf60d1bbb4 clients: shorten ECDIS layer name.
Bernhard Reiter <bernhard@intevation.de>
parents: 620
diff changeset
23 name: "Inland ECDIS chart Danube",
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
24 data: new TileLayer({
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
25 source: new TileWMS({
700
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
26 preload: 1,
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
27 url: "https://demo.d4d-portal.info/wms",
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
28 params: { LAYERS: "d4d", VERSION: "1.1.1", TILED: true }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
29 })
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 isVisible: true
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
32 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
33 {
716
22159077b564 client: add step to intersect with fairways
Bernhard Reiter <bernhard@intevation.de>
parents: 702
diff changeset
34 name: "Fairway Dimensions",
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
35 data: new VectorLayer({
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
36 source: new VectorSource(),
659
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
37 style: function(feature) {
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
38 return [
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
39 new Style({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
40 stroke: new Stroke({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
41 color: "rgba(0, 0, 255, 1.0)",
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
42 width: 2
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
43 })
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 new Style({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
46 text: new Text({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
47 font: 'bold 12px "Open Sans", "sans-serif"',
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
48 placement: "line",
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
49 fill: new Fill({
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
50 color: "black"
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
51 }),
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
52 text: "LOS: " + feature.get("level_of_service").toString()
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
53 //, zIndex: 10
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
54 })
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 }
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
58 }),
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
59 isVisible: true
620
ef00684e021f client: add showing special buoys
Bernhard Reiter <bernhard@intevation.de>
parents: 618
diff changeset
60 },
ef00684e021f client: add showing special buoys
Bernhard Reiter <bernhard@intevation.de>
parents: 618
diff changeset
61 {
747
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
62 name: "Waterway Area, named",
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
63 data: new VectorLayer({
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
64 source: new VectorSource({
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
65 strategy: bboxStrategy
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
66 }),
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
67 style: new Style({
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
68 stroke: new Stroke({
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
69 color: "rgba(0, 132, 0, 1)",
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
70 width: 2
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
71 })
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 isVisible: false
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
75 },
e33012c0aa7e client: move named waterway area layer higher
Bernhard Reiter <bernhard@intevation.de>
parents: 745
diff changeset
76 {
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
77 name: "Waterway Area",
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
78 data: new VectorLayer({
702
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
79 source: new VectorSource({
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
80 strategy: bboxStrategy
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
81 }),
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
82 style: new Style({
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
83 stroke: new Stroke({
688
89b497d0ee0f client: change waterway area style to dark green
Bernhard Reiter <bernhard@intevation.de>
parents: 663
diff changeset
84 color: "rgba(0, 102, 0, 1)",
89b497d0ee0f client: change waterway area style to dark green
Bernhard Reiter <bernhard@intevation.de>
parents: 663
diff changeset
85 width: 2
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
86 })
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 isVisible: true
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
90 },
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 name: "Waterway Axis",
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
93 data: new VectorLayer({
733
e57955c1996f client: improve code structure
Bernhard Reiter <bernhard@intevation.de>
parents: 716
diff changeset
94 source: new VectorSource({
e57955c1996f client: improve code structure
Bernhard Reiter <bernhard@intevation.de>
parents: 716
diff changeset
95 strategy: bboxStrategy
e57955c1996f client: improve code structure
Bernhard Reiter <bernhard@intevation.de>
parents: 716
diff changeset
96 }),
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
97 style: new Style({
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
98 stroke: new Stroke({
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
99 color: "rgba(0, 0, 255, .5)",
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
100 lineDash: [5, 5],
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
101 width: 2
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
102 })
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 isVisible: true
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
106 },
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 name: "Distance marks",
620
ef00684e021f client: add showing special buoys
Bernhard Reiter <bernhard@intevation.de>
parents: 618
diff changeset
109 data: new VectorLayer({
702
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
110 source: new VectorSource({
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
111 strategy: bboxStrategy
aaf5dbfb9512 client: improve loading of WFS features
Bernhard Reiter <bernhard@intevation.de>
parents: 701
diff changeset
112 })
620
ef00684e021f client: add showing special buoys
Bernhard Reiter <bernhard@intevation.de>
parents: 618
diff changeset
113 }),
628
ef9c733cc6aa client: show more wfs layers
Bernhard Reiter <bernhard@intevation.de>
parents: 625
diff changeset
114 isVisible: false
659
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
115 },
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
116 {
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
117 name: "Distance marks, Axis",
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
118 data: new VectorLayer({
701
8149772c62d6 client: add bbox loading strategy to riverkilometre
Bernhard Reiter <bernhard@intevation.de>
parents: 700
diff changeset
119 source: new VectorSource({
8149772c62d6 client: add bbox loading strategy to riverkilometre
Bernhard Reiter <bernhard@intevation.de>
parents: 700
diff changeset
120 strategy: bboxStrategy
8149772c62d6 client: add bbox loading strategy to riverkilometre
Bernhard Reiter <bernhard@intevation.de>
parents: 700
diff changeset
121 }),
700
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
122 style: function(feature, resolution) {
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
123 if (resolution < 10) {
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
124 var s = new Style({
691
d643ff60f607 Client: improve style of waterway axis.
Bernhard Reiter <bernhard@intevation.de>
parents: 688
diff changeset
125 image: new CircleStyle({
d643ff60f607 Client: improve style of waterway axis.
Bernhard Reiter <bernhard@intevation.de>
parents: 688
diff changeset
126 radius: 5,
700
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
127 fill: new Fill({ color: "rgba(255, 0, 0, 0.1)" }),
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
128 stroke: new Stroke({ color: "blue", width: 1 })
691
d643ff60f607 Client: improve style of waterway axis.
Bernhard Reiter <bernhard@intevation.de>
parents: 688
diff changeset
129 })
700
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
130 });
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
131 if (resolution < 6) {
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
132 s.setText(
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
133 new Text({
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
134 offsetY: 12,
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
135 font: '10px "Open Sans", "sans-serif"',
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
136 fill: new Fill({
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
137 color: "black"
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
138 }),
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
139 text: (feature.get("hectometre") / 10).toString()
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
140 })
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
141 );
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
142 }
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
143 return s;
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
144 } else {
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
145 return [];
8c3c43595d39 client: make kilometre style resolution depending
Bernhard Reiter <bernhard@intevation.de>
parents: 691
diff changeset
146 }
691
d643ff60f607 Client: improve style of waterway axis.
Bernhard Reiter <bernhard@intevation.de>
parents: 688
diff changeset
147 }
659
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
148 }),
ef658c66cfca schema: disable sfcgal
Bernhard Reiter <bernhard@intevation.de>
parents: 628
diff changeset
149 isVisible: true
790
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
150 },
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
151 {
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
152 name: "Bottlenecks",
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
153 data: new VectorLayer({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
154 source: new VectorSource({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
155 strategy: bboxStrategy
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
156 }),
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
157 style: new Style({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
158 stroke: new Stroke({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
159 color: "rgba(230, 230, 10, .8)",
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
160 width: 4
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
161 }),
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
162 fill: new Fill({
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
163 color: "rgba(230, 230, 10, .3)"
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
164 })
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
165 })
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
166 }),
1b82ae5e637e client: add bottleneck layer with first styling
Bernhard Reiter <bernhard@intevation.de>
parents: 783
diff changeset
167 isVisible: true
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
168 }
770
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents: 754
diff changeset
169 ],
793
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 790
diff changeset
170 identifiedFeatures: [],
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 790
diff changeset
171 currentMeasurement: null
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
172 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
173 getters: {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
174 layers: state => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
175 return state.layers;
754
105c421f99b1 refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents: 747
diff changeset
176 },
105c421f99b1 refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents: 747
diff changeset
177 getLayerByName: state => name => {
105c421f99b1 refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents: 747
diff changeset
178 return state.layers.find(layer => layer.name === name);
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
179 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
180 },
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
181 mutations: {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
182 toggleVisibility: (state, layer) => {
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
183 state.layers[layer].isVisible = !state.layers[layer].isVisible;
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
184 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
185 },
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents: 754
diff changeset
186 setIdentifiedFeatures: (state, identifiedFeatures) => {
c12ec7fde3f2 client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents: 754
diff changeset
187 state.identifiedFeatures = identifiedFeatures;
783
ab9604a46075 client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents: 782
diff changeset
188 },
ab9604a46075 client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents: 782
diff changeset
189 setOpenLayersMap: (state, map) => {
ab9604a46075 client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents: 782
diff changeset
190 state.openLayersMap = map;
793
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 790
diff changeset
191 },
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 790
diff changeset
192 setCurrentMeasurement: (state, measurement) => {
073394629ec6 client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents: 790
diff changeset
193 state.currentMeasurement = measurement;
585
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
194 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
195 }
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
196 };
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
197
ef307bd6b5d8 refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
198 export default MapStore;