Blame view

node_modules/vue-baidu-map/components/controls/Panorama.vue 616 Bytes
290144e9   易尊强   第一次
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  <script>
  import commonMixin from '../base/mixins/common.js'
  import {createSize} from '../base/factory.js'
  
  export default {
    name: 'bm-panorama',
    mixins: [commonMixin('control')],
    render () {},
    props: ['anchor', 'offset'],
    watch: {
      anchor () {
        this.reload()
      },
      offset () {
        this.reload()
      }
    },
    methods: {
      load () {
        const {BMap, map, anchor, offset} = this
        this.originInstance = new BMap.PanoramaControl({
          anchor: global[anchor],
          offset: offset && createSize(BMap, offset)
        })
        map.addControl(this.originInstance)
      }
    }
  }
  </script>