| | |
| | | const isShow = defineModel('show'); |
| | | const viewerRef = shallowRef(null); |
| | | let viewer = null; |
| | | |
| | | const store = useStore(); |
| | | const currentAreaPosition = ref({ height: 1987280, latitude: 27.636112, longitude: 115.732975 }); |
| | | let handler = null; |
| | |
| | | const isMapInitialized = ref(false); //地图加载 |
| | | const dataPointList = ref([]); |
| | | const activeEntity = ref(null); // 当前激活的点 |
| | | |
| | | // 获取弹框box |
| | | const detailId = ref(''); |
| | | const createLabelDom = data => { |
| | |
| | | render(vNode, tooltipContainer); |
| | | return tooltipContainer; |
| | | }; |
| | | |
| | | // 弹框位置刷新 |
| | | const labelBoxUpdate = () => { |
| | | if (!currentClickEntity) return; |
| | |
| | | const detailClick = () => { |
| | | removeLabel(); |
| | | // 给父组件传值 |
| | | emit('update:show', false); |
| | | // emit('update:show', false); //关闭地图弹框 |
| | | emit('lookDetail', detailId.value); |
| | | }; |
| | | |
| | | // 恢复所有点的默认图标 |
| | | const restoreAllIcons = () => { |
| | | dataPointEntities.value.forEach(entity => { |
| | | // console.log('entity.billboard.image', entity.billboard.image); |
| | | |
| | | if (entity.billboard) { |
| | | entity.billboard.image = |
| | | props.dotData.resultType === 2 ? getEventImage(entity.status) : defaultIcon; |
| | |
| | | try { |
| | | const res = await getMapInfoAPI(ids); |
| | | dataPointList.value = res.data.data || []; |
| | | console.log('dataPointList.value',dataPointList.value); |
| | | |
| | | // 确保地图已初始化后再渲染 |
| | | if (isMapInitialized.value && viewer) { |
| | | renderDataPoint(dataPointList.value); |