修复修改点,点击编辑,其他点异常添加问题
parent
504b9c9225
commit
e0396fe0f2
|
@ -613,15 +613,16 @@ export default {
|
|||
//显示地图按钮
|
||||
this.updatePointVisible = true;
|
||||
this.isClickEventOpen = false;//关闭弹窗事件
|
||||
cu.removePoint()
|
||||
// cu.removePoint()
|
||||
//将当前选择要修改的点变为红色
|
||||
if (simpleData.length !== 0) {
|
||||
for (let i in simpleData) {
|
||||
if( i == index ){
|
||||
cu.addPoint(simpleData[index].lng, simpleData[index].lat, 10,true);
|
||||
}else{
|
||||
cu.addPoint(simpleData[i].lng, simpleData[i].lat, 10);
|
||||
}
|
||||
// else{
|
||||
// cu.addPoint(simpleData[i].lng, simpleData[i].lat, 10);
|
||||
// }
|
||||
}
|
||||
}
|
||||
//保存当前修改的点信息
|
||||
|
|
|
@ -162,17 +162,20 @@ class CesiumUtils {
|
|||
this.viewer.imageryLayers.remove(this.privide);
|
||||
}
|
||||
|
||||
static addPoint(pLon, pLat, pAlt, isSelected = false) {
|
||||
static addPoint(pLon, pLat, pAlt, isSelected = false,pointId = null) {
|
||||
var pointEntity = this.viewer.entities.add({
|
||||
id: pointId,
|
||||
position: Cesium.Cartesian3.fromDegrees(pLon, pLat, pAlt),
|
||||
point: {
|
||||
pixelSize: 10,
|
||||
color: isSelected ? Cesium.Color.RED : Cesium.Color.YELLOW,
|
||||
},
|
||||
});
|
||||
return pointEntity;
|
||||
}
|
||||
|
||||
//移除某个点
|
||||
static removePoint() {
|
||||
this.viewer.entities.removeById("theNewPoint");
|
||||
this.viewer.entities.removeAll();
|
||||
}
|
||||
//修改点的位置
|
||||
|
|
Loading…
Reference in New Issue