Mercurial > gemma
annotate client/src/map/store.js @ 973:b6fec8f85599
Generate TINs and octrees in sounding result importer.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 18 Oct 2018 13:09:49 +0200 |
parents | 2025074ad835 |
children | 3da707172772 |
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 |
967
2025074ad835
refac: extracted layer configuration to layers
Thomas Junk <thomas.junk@intevation.de>
parents:
939
diff
changeset
|
3 import { layers } from "../layers/layers"; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
4 |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
5 const MapStore = { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
6 namespaced: true, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
7 state: { |
783
ab9604a46075
client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents:
782
diff
changeset
|
8 openLayersMap: null, |
967
2025074ad835
refac: extracted layer configuration to layers
Thomas Junk <thomas.junk@intevation.de>
parents:
939
diff
changeset
|
9 layers: layers, |
836
0b994949a4a0
client: make Morphtool selection more robust
Bernhard Reiter <bernhard@intevation.de>
parents:
826
diff
changeset
|
10 // 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
|
11 // 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
|
12 identifiedFeatures: [], |
816
cd79f62794dd
client: prepare survey selection
Bernhard Reiter <bernhard@intevation.de>
parents:
804
diff
changeset
|
13 currentMeasurement: null, |
cd79f62794dd
client: prepare survey selection
Bernhard Reiter <bernhard@intevation.de>
parents:
804
diff
changeset
|
14 selectedMorph: null |
585
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 getters: { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 layers: state => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
18 return state.layers; |
754
105c421f99b1
refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents:
747
diff
changeset
|
19 }, |
105c421f99b1
refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents:
747
diff
changeset
|
20 getLayerByName: state => name => { |
105c421f99b1
refac: small improvements to code structure
Thomas Junk <thomas.junk@intevation.de>
parents:
747
diff
changeset
|
21 return state.layers.find(layer => layer.name === name); |
585
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 }, |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
24 mutations: { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
25 toggleVisibility: (state, layer) => { |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
26 state.layers[layer].isVisible = !state.layers[layer].isVisible; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
27 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
|
28 }, |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
754
diff
changeset
|
29 setIdentifiedFeatures: (state, identifiedFeatures) => { |
c12ec7fde3f2
client: add simple identify top area box
Bernhard Reiter <bernhard@intevation.de>
parents:
754
diff
changeset
|
30 state.identifiedFeatures = identifiedFeatures; |
783
ab9604a46075
client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents:
782
diff
changeset
|
31 }, |
ab9604a46075
client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents:
782
diff
changeset
|
32 setOpenLayersMap: (state, map) => { |
ab9604a46075
client: add move after clicking search result
Bernhard Reiter <bernhard@intevation.de>
parents:
782
diff
changeset
|
33 state.openLayersMap = map; |
793
073394629ec6
client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents:
790
diff
changeset
|
34 }, |
073394629ec6
client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents:
790
diff
changeset
|
35 setCurrentMeasurement: (state, measurement) => { |
073394629ec6
client: add measurement and improve identify
Bernhard Reiter <bernhard@intevation.de>
parents:
790
diff
changeset
|
36 state.currentMeasurement = measurement; |
816
cd79f62794dd
client: prepare survey selection
Bernhard Reiter <bernhard@intevation.de>
parents:
804
diff
changeset
|
37 }, |
826
90a601884ff2
client: improve survey selection for Morphtool
Bernhard Reiter <bernhard@intevation.de>
parents:
816
diff
changeset
|
38 setSelectedMorph: (state, selectedMorph) => { |
816
cd79f62794dd
client: prepare survey selection
Bernhard Reiter <bernhard@intevation.de>
parents:
804
diff
changeset
|
39 state.selectedMorph = selectedMorph; |
585
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
40 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
41 } |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
42 }; |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
43 |
ef307bd6b5d8
refac: restructured client application
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
44 export default MapStore; |