40 lines
594 B
Vue
40 lines
594 B
Vue
|
<template>
|
||
|
<div>
|
||
|
<div id="map"/>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
|
||
|
let mapInstance
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
}
|
||
|
},
|
||
|
mounted() {
|
||
|
this.fnMapInit()
|
||
|
},
|
||
|
beforeDestroy() {
|
||
|
mapInstance = null
|
||
|
},
|
||
|
methods: {
|
||
|
fnMapInit() {
|
||
|
mapInstance = new window.BMapGL.Map('map')
|
||
|
mapInstance.centerAndZoom(new window.BMapGL.Point('119.502057', '39.933306'), 15)
|
||
|
mapInstance.enableScrollWheelZoom(true)
|
||
|
},
|
||
|
addPoint() {
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style scoped lang="scss">
|
||
|
#map {
|
||
|
width: calc(100vw - 210px);
|
||
|
height: calc(100vh - 84px);
|
||
|
}
|
||
|
</style>
|