Mercurial > gemma
view client/src/components/layers/Layers.vue @ 3501:c5c7cc24fe72
client: spuc12: implemented nash sutcliffe for forcast vs reality accuracy indicator
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 28 May 2019 11:28:38 +0200 |
parents | 9fba1be118e7 |
children | d85d8de8c28c |
line wrap: on
line source
<template> <div :class="[ 'box ui-element rounded bg-white text-nowrap', { expanded: showLayers } ]" > <div class="position-relative" style="width: 18rem; min-height: 350px;"> <UIBoxHeader icon="layer-group" :title="label" :closeCallback="close" :actions="[ { callback: refreshLayers, icon: sourcesLoading ? 'spinner' : 'sync' } ]" /> <div class="small" v-if="openLayersMaps.length"> <Layerselect layerId="OPENSTREETMAP" /> <Layerselect layerId="INLANDECDIS" /> <Layerselect layerId="WATERWAYAREA" /> <Layerselect layerId="STRETCHES" /> <Layerselect layerId="SECTIONS" /> <Layerselect layerId="FAIRWAYDIMENSIONSLOS3" /> <Layerselect layerId="FAIRWAYDIMENSIONSLOS2" /> <Layerselect layerId="FAIRWAYDIMENSIONSLOS1" /> <Layerselect layerId="WATERWAYAXIS" /> <Layerselect layerId="WATERWAYPROFILES" /> <Layerselect layerId="BOTTLENECKS" /> <Layerselect layerId="BOTTLENECKISOLINE" /> <Layerselect layerId="DIFFERENCES" /> <Layerselect layerId="BOTTLENECKSTATUS" /> <Layerselect layerId="BOTTLENECKFAIRWAYAVAILABILITY" /> <Layerselect layerId="DATAAVAILABILITY" /> <Layerselect layerId="DISTANCEMARKS" /> <Layerselect layerId="DISTANCEMARKSAXIS" /> <Layerselect layerId="GAUGES" /> </div> <UISpinnerOverlay v-else style="top: 34px;" /> </div> </div> </template> <script> /* 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> * Markus Kottländer <markus.kottlaender@intevation.de> */ import { mapState } from "vuex"; export default { components: { Layerselect: () => import("./Layerselect") }, computed: { ...mapState("application", ["showLayers"]), ...mapState("map", ["openLayersMaps"]), label() { return this.$gettext("Map Layers"); }, sourcesLoading() { let counter = 0; this.openLayersMaps.forEach(map => { let layers = map.getLayers().getArray(); for (let i = 0; i < layers.length; i++) { if (layers[i].getSource().loading) counter++; } }); return counter; } }, methods: { close() { this.$store.commit("application/showLayers", false); }, refreshLayers() { this.$store.dispatch("map/refreshLayers"); } } }; </script>