|
|
|
@ -17,7 +17,7 @@
|
|
|
|
|
:showInfoData="showInfoData"
|
|
|
|
|
@closeDetailsInfo="closeDetailsInfo"
|
|
|
|
|
/>
|
|
|
|
|
<ShowImage v-if="detailsInfoShow" :showInfoData="showInfoData"/>
|
|
|
|
|
<ShowImage ref="showImageRef" v-if="detailsInfoShow" :showInfoData="showInfoData"/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
@ -33,6 +33,7 @@
|
|
|
|
|
const airLineForm = ref({});
|
|
|
|
|
const map = ref()
|
|
|
|
|
const graphicLayer = ref()
|
|
|
|
|
const showImageRef = ref()
|
|
|
|
|
|
|
|
|
|
watch(() => map.value, (val) => {
|
|
|
|
|
if (val) {
|
|
|
|
@ -47,23 +48,42 @@
|
|
|
|
|
const changeLeftMenuShow = (item) => {
|
|
|
|
|
GetAiAchievement({id:item.id}).then(res => {
|
|
|
|
|
showInfoData.value = res
|
|
|
|
|
const position:any = [res.lng, res.lat]
|
|
|
|
|
const pointGraphic = new mars3d.graphic.BillboardEntity({
|
|
|
|
|
position: position,
|
|
|
|
|
style: {
|
|
|
|
|
image: '/projecthome/project_location.png',
|
|
|
|
|
width: 53,
|
|
|
|
|
height: 97,
|
|
|
|
|
scale: 1,
|
|
|
|
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
|
|
|
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
|
|
clampToGround: true,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
map.value?.flyToPoint(position);
|
|
|
|
|
graphicLayer.value?.clear()
|
|
|
|
|
graphicLayer.value?.addGraphic(pointGraphic)
|
|
|
|
|
detailsInfoShow.value = true;
|
|
|
|
|
|
|
|
|
|
// 2. 循环数据,添加点位
|
|
|
|
|
res.aiAchievementDetailList.forEach((item, index) => {
|
|
|
|
|
const bottomPos = Cesium.Cartesian3.fromDegrees(item.lng, item.lat, 0)
|
|
|
|
|
const topPos = Cesium.Cartesian3.fromDegrees(item.lng, item.lat, 100)
|
|
|
|
|
const line = new mars3d.graphic.PolylineEntity({
|
|
|
|
|
positions: [bottomPos, topPos],
|
|
|
|
|
style: {
|
|
|
|
|
width: 2,
|
|
|
|
|
color: "#ffffff"
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
graphicLayer.value?.clear()
|
|
|
|
|
graphicLayer.value?.addGraphic(line)
|
|
|
|
|
const graphic = new mars3d.graphic.BillboardEntity({
|
|
|
|
|
position: topPos,
|
|
|
|
|
style: {
|
|
|
|
|
image: item.image, // 直接用图片当做图标
|
|
|
|
|
width: 80, // 宽度(像素)
|
|
|
|
|
height: 60, // 高度(像素)
|
|
|
|
|
// scale: 0.1, // 缩放比例
|
|
|
|
|
clampToGround: false,
|
|
|
|
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
|
|
|
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
graphic.on(mars3d.EventType.click, function (event) {
|
|
|
|
|
console.log("点击了图片", item.image, item.id, index)
|
|
|
|
|
showImageRef.value.openPreview(index)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
graphicLayer.value?.addGraphic(graphic)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 关闭右侧标注
|
|
|
|
|