Mercurial > gemma
view client/src/zoom/zoom.vue @ 1123:d9e6a1f6f394 store-refactoring
moved all collapse flags for UI elements to store
UI elements can now be expanded/collapsed via the application store
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 06 Nov 2018 13:00:17 +0100 |
parents | 595654ad3f66 |
children | a047a2735b9c |
line wrap: on
line source
<template> <div class="d-flex flex-column buttoncontainer align-content-between"> <button class="zoomButton shadow ui-element" @click="zoomIn">+</button> <button class="zoomButton shadow ui-element" @click="zoomOut">-</button> </div> </template> <style lang="scss" scoped> .buttoncontainer { width: $icon-width; height: $zoombutton-container-height; margin-top: $sidebar-height; margin-left: $offset; } .zoomButton { position: relative; background-color: white; border-radius: $border-radius; min-height: $icon-width; min-width: $icon-width; margin-right: $offset; margin-bottom: auto; z-index: 2; outline: none; border: 0px; } </style> <script> import { mapState } from "vuex"; export default { name: "zoom", computed: { ...mapState("map", ["openLayersMap"]), zoomLevel: { get() { return this.openLayersMap.getView().getZoom(); }, set(value) { this.openLayersMap.getView().animate({ zoom: value }, 700); } } }, methods: { zoomIn() { this.zoomLevel = this.zoomLevel + 1; }, zoomOut() { this.zoomLevel = this.zoomLevel - 1; } } }; </script>