view client/src/components/importoverview/SoundingResultDetail.vue @ 2774:6c1c4f55d99b

sidebar: only update when user is logged in
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 22 Mar 2019 12:45:53 +0100
parents 0ab7985ef008
children 80815b0a665c
line wrap: on
line source

<template>
  <div>
    <span class="empty"></span>
    <a @click="zoomTo()" class="text-info pointer">
      {{ details.summary.bottleneck }}
    </a>
  </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>
 */
import { mapState } from "vuex";

export default {
  name: "soundingresultdetails",
  props: ["entry"],
  mounted() {
    this.$store.commit("imports/hideAdditionalInfo");
  },
  computed: {
    ...mapState("imports", ["showAdditional", "details"])
  },
  methods: {
    moveMap(coordinates) {
      this.$store.commit("map/moveMap", {
        coordinates: coordinates,
        zoom: 17,
        preventZoomOut: true
      });
    },
    zoomTo() {
      const { lat, lon, bottleneck, date } = this.details.summary;
      const coordinates = [lat, lon];
      this.moveMap(coordinates);
      this.$store
        .dispatch("bottlenecks/setSelectedBottleneck", bottleneck)
        .then(() => {
          this.$store.commit("bottlenecks/setSelectedSurveyByDate", date);
        });
    }
  }
};
</script>

<style></style>