view client/src/components/importoverview/SoundingResultDetail.vue @ 2608:13377f2a5c42

overview2: agm details prototype implemented
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 13 Mar 2019 09:45:29 +0100
parents 5d0e5159190f
children 39a05f8c34e6
line wrap: on
line source

<template>
  <div>
    <span class="empty"></span>
    <a @click="zoomTo()" class="text-info pointer">
      {{ entry.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>
 */
export default {
  name: "soundingresultdetails",
  props: ["entry"],
  methods: {
    moveMap(coordinates) {
      this.$store.commit("map/moveMap", {
        coordinates: coordinates,
        zoom: 17,
        preventZoomOut: true
      });
    },
    zoomTo() {
      const { lat, lon, bottleneck, date } = this.entry.summary;
      const coordinates = [lat, lon];
      this.moveMap(coordinates);
      this.$store
        .dispatch("bottlenecks/setSelectedBottleneck", bottleneck)
        .then(() => {
          this.$store.commit("bottlenecks/setSelectedSurveyByDate", date);
        });
    }
  }
};
</script>

<style></style>