view client/src/zoom/zoom.vue @ 1160:c8c26912754c

disable identifying when draw/cut mode are active
author Markus Kottlaender <markus@intevation.de>
date Tue, 13 Nov 2018 14:50:12 +0100
parents 7acd24889f1d
children b23622905a3f
line wrap: on
line source

<template>
    <div class="d-flex buttoncontainer shadow" :style="showSplitscreen ? 'margin-bottom: 51vh' : ''">
        <button class="zoomButton rounded-left ui-element border-right" @click="zoomIn">
            <i class="fa fa-plus"></i>
        </button>
        <button class="zoomButton rounded-right ui-element" @click="zoomOut">
            <i class="fa fa-minus"></i>
        </button>
    </div>
</template>

<style lang="scss" scoped>
.buttoncontainer {
  position: absolute;
  bottom: 0;
  left: 50%;
  margin-left: -$icon-width;
  margin-bottom: $offset;
}
.zoomButton {
  background-color: white;
  min-height: $icon-width;
  min-width: $icon-width;
  margin-bottom: auto;
  z-index: 2;
  outline: none;
  border: 0px;
}
</style>
<script>
import { mapState } from "vuex";

export default {
  name: "zoom",
  computed: {
    ...mapState("map", ["openLayersMap"]),
    ...mapState("application", ["showSplitscreen"]),
    zoomLevel: {
      get() {
        return this.openLayersMap.getView().getZoom();
      },
      set(value) {
        this.openLayersMap.getView().animate({ zoom: value, duration: 300 });
      }
    }
  },
  methods: {
    zoomIn() {
      this.zoomLevel = this.zoomLevel + 1;
    },
    zoomOut() {
      this.zoomLevel = this.zoomLevel - 1;
    }
  }
};
</script>