2024-09-03 22:09:21 +08:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<baidu-map
|
|
|
|
:center="position"
|
2024-09-09 17:22:18 +08:00
|
|
|
:zoom="16" :scroll-wheel-zoom=true
|
|
|
|
style="width: auto; height: 40vh;"
|
2024-12-05 16:22:00 +08:00
|
|
|
:map-type="currentMapType"
|
2024-09-03 22:09:21 +08:00
|
|
|
>
|
|
|
|
<bm-map-type
|
|
|
|
:map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']"
|
|
|
|
anchor="BMAP_ANCHOR_TOP_LEFT"
|
|
|
|
></bm-map-type>
|
|
|
|
<bm-marker :position="position"></bm-marker>
|
|
|
|
</baidu-map>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { BmlHeatmap } from "vue-baidu-map"; //引人
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
BmlHeatmap,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
selectedDept: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {
|
|
|
|
return {};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
position() {
|
|
|
|
return {
|
2024-12-05 16:22:00 +08:00
|
|
|
lng: parseFloat(this.selectedDept?.longitude),
|
|
|
|
lat: parseFloat(this.selectedDept?.latitude),
|
2024-09-03 22:09:21 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
2024-09-09 17:22:18 +08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
currentMapType: 'BMAP_HYBRID_MAP',
|
2024-12-05 16:22:00 +08:00
|
|
|
|
2024-09-09 17:22:18 +08:00
|
|
|
}}
|
2024-09-03 22:09:21 +08:00
|
|
|
};
|
|
|
|
</script>
|