<template>
  <div class="map-btns" :class="{isFull: value}">
    <img
      v-for="btn in btns"
      :key="btn.name"
      @click="$emit(btn.name, btn.name == 'input' ? !value : null)"
      :src="require(`@/assets/images/${btn.img}`)" />
  </div>
</template>

<script>
export default {
  name: 'MapBtns',
  props: {
    value: {
      type: Boolean,
    }
  },
  data() {
    return {
      btns: [
        {name: 'input', img: 'btn1.png'},
        // {name: 'zoomin', img: 'btn2.png'},
        {name: 'zoomout', img: 'btn3.png'},
        {name: 'info', img: 'btn4.png'},
        {name: 'sensor', img: 'btn5.png'},
        {name: 'position', img: 'btn6.png'},
      ]
    }
  },
}
</script>

<style lang="stylus" scoped>
.map-btns
  position fixed
  right calc(50% + .15rem)
  bottom .1rem
  transition right .5s ease-in-out
  z-index 999
  &.isFull
    right .05rem
  img
    display block
    width .2rem
    height @width
    margin-top .03rem
    cursor pointer
    transition transform .3s ease-in-out
    &:hover
      transform scale(1.25)
</style>
