效果图如下:
1. 从后台获取遍历的数据,先遍历循环加上点位
setTimeout(() => {
this.UAVpoint.forEach(result => {
var pinBuilder = new Cesium.PinBuilder();
var bluePin = this.viewer.entities.add({
id: result["ID"],
name: result["Name"],
position: Cesium.Cartesian3.fromDegrees(result["Longitude"], result["Latitude"]),
billboard: {
image: '../../../../ecology/assets/images/Icon/m1.png',
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
}
});
})
}, 200);
2. 再次遍历循环为每个加上气泡弹窗
setTimeout(() => {
this.UAVpoint.forEach(result => {
var handler = new Cesium.ScreenSpaceEventHandler(this.vi