annotate client/src/store/identify.js @ 1096:aa1f5daf6fc9

refac: centralized stores
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 30 Oct 2018 16:55:29 +0100
parents client/src/identify/store.js@ca628dce90dd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1019
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
1 /*
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
2 * This is Free Software under GNU Affero General Public License v >= 3.0
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
3 * without warranty, see README.md and license for details.
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
4 *
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
5 * SPDX-License-Identifier: AGPL-3.0-or-later
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
6 * License-Filename: LICENSES/AGPL-3.0.txt
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
7 *
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
8 * Copyright (C) 2018 by via donau
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
9 * – Österreichische Wasserstraßen-Gesellschaft mbH
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
10 * Software engineering by Intevation GmbH
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
11 *
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
12 * Author(s):
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
13 * Thomas Junk <thomas.junk@intevation.de>
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
14 */
ca628dce90dd Licensing information added
Thomas Junk <thomas.junk@intevation.de>
parents: 975
diff changeset
15
975
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 // note that some identified features may not have an id
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 // especially related to drawing in our own vector layer
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 const IndentifyStore = {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 namespaced: true,
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 state: {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
22 identifiedFeatures: [],
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
23 currentMeasurement: null
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
24 },
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
25 getters: {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 identifiedFeatures: state => {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
27 return state.identifiedFeatures;
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
28 },
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
29 currentMeasurement: state => {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
30 return state.currentMeasurement;
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
31 }
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
32 },
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
33 mutations: {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
34 setIdentifiedFeatures: (state, identifiedFeatures) => {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
35 state.identifiedFeatures = identifiedFeatures;
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
36 },
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
37 setCurrentMeasurement: (state, measurement) => {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
38 state.currentMeasurement = measurement;
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
39 }
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
40 }
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
41 };
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
42
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
43 export default IndentifyStore;