<template>
  <div>
    <baidu-map
      :center="position"
      :zoom="16" :scroll-wheel-zoom=true
      style="width: auto; height: 40vh;"
      :map-type="currentMapType"
    >
      <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 {
        lng: parseFloat(this.selectedDept?.longitude),
        lat: parseFloat(this.selectedDept?.latitude),
      };
    },
  },
  data() {
      return {
        currentMapType: 'BMAP_HYBRID_MAP',

      }}
};
</script>
