先拓企业站
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.
 
 
 
 

55 lines
1.0 KiB

<script>
import commonMixin from '../base/mixins/common.js'
import {createSize} from '../base/factory.js'
export default {
name: 'bm-navigation',
render () {},
mixins: [commonMixin('control')],
props: {
anchor: {
type: String
},
offset: {
type: Object
},
type: {
type: String
},
showZoomInfo: {
type: Boolean
},
enableGeolocation: {
type: Boolean,
default: false
}
},
watch: {
anchor () {
this.reload()
},
offset () {
this.reload()
},
type () {
this.reload()
},
showZoomInfo () {
this.reload()
}
},
methods: {
load () {
const {BMap, map, anchor, offset, type, showZoomInfo, enableGeolocation} = this
this.originInstance = new BMap.NavigationControl({
anchor: global[anchor],
offset: offset && createSize(BMap, offset),
type: global[type],
showZoomInfo,
enableGeolocation
})
map.addControl(this.originInstance)
}
}
}
</script>