view 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
line wrap: on
line source

/*
 * This is Free Software under GNU Affero General Public License v >= 3.0
 * without warranty, see README.md and license for details.
 * 
 * SPDX-License-Identifier: AGPL-3.0-or-later
 * License-Filename: LICENSES/AGPL-3.0.txt
 * 
 * Copyright (C) 2018 by via donau 
 *   – Österreichische Wasserstraßen-Gesellschaft mbH
 * Software engineering by Intevation GmbH
 * 
 * Author(s):
 * Thomas Junk <thomas.junk@intevation.de>
 */

// note that some identified features may not have an id
// especially related to drawing in our own vector layer

const IndentifyStore = {
  namespaced: true,
  state: {
    identifiedFeatures: [],
    currentMeasurement: null
  },
  getters: {
    identifiedFeatures: state => {
      return state.identifiedFeatures;
    },
    currentMeasurement: state => {
      return state.currentMeasurement;
    }
  },
  mutations: {
    setIdentifiedFeatures: (state, identifiedFeatures) => {
      state.identifiedFeatures = identifiedFeatures;
    },
    setCurrentMeasurement: (state, measurement) => {
      state.currentMeasurement = measurement;
    }
  }
};

export default IndentifyStore;