You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
616 B
30 lines
616 B
3 months ago
|
<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>
|