餐饮油烟智能监测与监管一体化平台
feiyu02
2026-03-20 20cdb83586daabfb15fc056c4c97eb8e7ccaf928
src/components/map/BaseMap.vue
@@ -3,17 +3,30 @@
</template>
<script setup>
import { onMounted, onUnmounted } from 'vue';
import { createMap, map, destroyMap } from '@/utils/map/index';
import { onMounted, onUnmounted } from 'vue'
import { onMapMounted, createMap, satellite, map, destroyMap } from '@/utils/map/index'
const props = defineProps({
  showSatellite: {
    type: Boolean,
    default: false,
  },
})
onMounted(() => {
  // 高德地图初始化
  setTimeout(() => {
    createMap('container');
  }, 1000);
});
    createMap('container')
    onMapMounted(() => {
      if (props.showSatellite) {
        satellite.show()
      } else {
        satellite.hide()
      }
    })
  }, 1000)
})
onUnmounted(() => {
  destroyMap();
});
  destroyMap()
})
</script>
<style>
#container {