cesium实时获取卫星的动态信息,包括经纬度和名称(onTick)

效果如图下显示,实时获取经纬度,显示到二维图上

 

 

1. 添加卫星,然后监听方法:

 this.viewer.dataSources.add(Cesium.CzmlDataSource.load('czml文件名称')).then(dataSource => {
          var satellite = dataSource.entities.getById("id名称,你给卫星起的id名称");
          this.viewer.trackedEntity = satellite;
          //每次运行一个卫星,先清除上一个卫星的时间轴
          this.viewer.clock.onTick.removeEventListener(this.eventFun);
          开始实时动态的方法
          this.getSatelliteInfo(satellite)
 });    

2. getSatelliteInfo方法:

getSatelliteInfo(satellite){

    var property;
    var that = this;
    property = new Cesium.SampledPositionProperty();
    var satellite = satellite;

    for (var ind = 0; ind < 292; ind++) {

      console.log(s

你可能感兴趣的:(leaflet相关问题,cesium,angular4)