首页项目中心点图标修改,机场图标修改

main
zhufu 2025-07-17 15:43:54 +08:00
parent 0ec3d35163
commit e829c58994
9 changed files with 60 additions and 45 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

View File

@ -406,23 +406,15 @@ const getLocationCenter = () => {
const position = { lng: lon, lat }
project.value.centerLng = lon
project.value.centerLat = lat
const pointGraphic = new mars3d.graphic.PointEntity({
const pointGraphic = new mars3d.graphic.BillboardEntity({
position: Cesium.Cartesian3.fromDegrees(lon, lat, height),
style: {
color: '#ff0000',
pixelSize: 10,
outlineColor: '#ffffff',
outlineWidth: 2,
label: {
text: `经度: ${lon.toFixed(6)}\n纬度: ${lat.toFixed(6)}`,
font_size: 16,
color: '#000000',
outline: true,
outlineColor: '#ffffff',
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
image: '/projecthome/project_location.png',
width: 53,
height: 97,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffsetY: -20
}
}
})
props.graphicLayer.clear()

View File

@ -85,6 +85,7 @@ const selectProject = (item) => {
if(props.activeProject != item.Id){
props.airPort.latitude = null
props.airPort.longitude = null
props.airPort.mode_code = null
getClient().unsubscribe(lastSubscriptUrl.value,(error, res) => {})
}
emits('update:activeProject',item.Id)
@ -99,24 +100,16 @@ const selectProject = (item) => {
})
let { centerLat:lat, centerLng: lon } = res.workspace
const position:any = [lon, lat]
const pointGraphic = new mars3d.graphic.PointEntity({
const pointGraphic = new mars3d.graphic.BillboardEntity({
position: position,
style: {
color: '#ff0000',
pixelSize: 10,
outlineColor: '#ffffff',
outlineWidth: 2,
clampToGround: true,
label: {
text: `${res.workspace.workspaceName}`,
font_size: 16,
color: '#000000',
outline: true,
outlineColor: '#ffffff',
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
image: '/projecthome/project_location.png',
width: 53,
height: 97,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffsetY: -20
}
clampToGround: true,
}
})
graphicLayer.value.clear()

View File

@ -39,6 +39,7 @@ const airRoute = ref({
const airPort = ref({
latitude: null,
longitude: null,
mode_code: null,
});
const activeProject = ref('')
const DESIGN_WIDTH = 1912
@ -76,6 +77,7 @@ const connectionCallback = () => {
if (rs.data.latitude && rs.data.longitude) {
airPort.value.latitude = rs.data.latitude;
airPort.value.longitude = rs.data.longitude;
airPort.value.mode_code = rs.data.mode_code;
}
}
});

View File

@ -211,6 +211,7 @@ const generatePreviewPoint = (placemark)=>{
//
let homeStartGraphic;
let homeStartGraphicLive;
let graphic = null;
@ -1669,17 +1670,22 @@ const loadChangGuangLayer = ()=>{
}
// //
let position = [props.homeAirport.longitude, props.homeAirport.latitude, 70];
let airportImg = props.homeAirport.mode_code == 4? '/projecthome/work_airport.png': '/projecthome/standby_airport.png'
let airportLiveImg = props.homeAirport.mode_code == 4? '/projecthome/work_airport_live.png': '/projecthome/standby_airport_live.png'
//
if (homeStartGraphic) {
if (homeStartGraphic && homeStartGraphicLive) {
homeStartGraphic.position = position
homeStartGraphic.image = airportImg
homeStartGraphicLive.position = position
homeStartGraphicLive.image = airportLiveImg
} else {
homeStartGraphic = new mars3d.graphic.BillboardEntity({
id: 'set-home-airport',
position: position,
style: {
image: '/projecthome/airport.png',
width: 35,
height: 59,
image: airportImg,
width: 118,
height: 133,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
@ -1693,10 +1699,32 @@ const loadChangGuangLayer = ()=>{
},
},
});
homeStartGraphicLive = new mars3d.graphic.BillboardEntity({
id: 'set-home-airport-live',
position: position,
style: {
image: airportLiveImg,
width: 21,
height: 21,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(45, -107),
label: {
text: '机场',
font_size: 14,
color: '#ffffff',
outline: true,
outlineColor: '#000000',
pixelOffsetY: -70,
},
},
});
homeStartGraphic.on(mars3d.EventType.click, function (event) {
emits('clickAirPort')
});
graphicLayer.addGraphic(homeStartGraphic);
graphicLayer.addGraphic(homeStartGraphicLive);
}
}
//