Newer
Older
smartwell_front / src / views / home / alarm / current / components / map.vue
lyg on 5 Sep 755 bytes 未开发模块静态页面
<!--
  Description: 报警管理-报警地图
  Author: 李亚光
  Date: 2023-07-08
 -->
<script lang="ts" setup name="AlarmMap">
import AMap from '@/components/map/index.vue'
const $props = defineProps({
  height: {
    type: Number,
    default: 0,
  },
})
// 地图实例
const mapRef = ref()
// 地图加载状态
const completeFlag = ref(false)
// 地图加载完成
const completeMap = () => {
  completeFlag.value = true
  console.log('地图加载完成')
}
defineExpose({
  mapRef,
  completeFlag,
})
</script>

<template>
  <div :style="`height: ${$props.height}px`" class="map-container">
    <a-map ref="mapRef" :zoom="14" @complete="completeMap" />
  </div>
</template>

<style lang="scss" scoped>
.map-container {
  width: 100%;
}
</style>