• Cesium 遥感卫星影像推送效果绘制


    //添加卫星
            function addSatellite() {
                satellite.curRouteLine \= viewer.entities.add({
                    name: "satelliteline",
                    polyline: {
                        positions: new Cesium.CallbackProperty(function (time, result) {
                            return satellite.curRoutePositions;
                        }, false),
                        material: new Cesium.ColorMaterialProperty(Cesium.Color.YELLOW),
                         3,
                    },
                });
    
                satellite.entity \= viewer.entities.add({
                    position: Cesium.Cartesian3.fromDegrees(\-75.59777, 40.03883),
                    billboard: {
                        image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADJSURBVDhPnZHRDcMgEEMZjVEYpaNklIzSEfLfD4qNnXAJSFWfhO7w2Zc0Tf9QG2rXrEzSUeZLOGm47WoH95x3Hl3jEgilvDgsOQUTqsNl68ezEwn1vae6lceSEEYvvWNT/Rxc4CXQNGadho1NXoJ+9iaqc2xi2xbt23PJCDIB6TQjOC6Bho/sDy3fBQT8PrVhibU7yBFcEPaRxOoseTwbwByCOYf9VGp1BYI1BA+EeHhmfzKbBoJEQwn1yzUZtyspIQUha85MpkNIXB7GizqDEECsAAAAASUVORK5CYII=",
                    },
                    label: {
                        text: 'Landsat8'
                    },
                    polyline: {
                        positions: new Cesium.CallbackProperty(function (time, result) {
                            //return satellite.entity.position.concat(satellite.curNadir);
                            return (satellite.curNadir && satellite.entity) ? \[satellite.entity.position.\_value, satellite.curNadir\] : \[\]
                        }, false),
                        material: new Cesium.ColorMaterialProperty(Cesium.Color.BLUE),
                         1
                    }
                });
                var redCone = viewer.entities.add({//红色圆锥体
                    name: 'Red cone',
                    position: new Cesium.CallbackProperty(function (time, result) {
                        if (satellite.entity) {
                            let p \= cesiumCoordUtil.cartesian3ToDegree2(satellite.entity.position.\_value);
                            return Cesium.Cartesian3.fromDegrees(p.lon, p.lat, p.height / 6 \* 5);
                        } else {
                            return Cesium.Cartesian3.fromDegrees(0, 0, 0);
                        }
    
                    }, false),
                    cylinder: {
                        length: new Cesium.CallbackProperty(function (time, result) {
                            return (satellite.entity ? cesiumCoordUtil.cartesian3ToDegree2(satellite.entity.position.\_value).height : 0) / 3;
                        }, false),
                        topRadius: 0.0,
                        bottomRadius: new Cesium.CallbackProperty(function (time, result) {
                            return (satellite.entity ? cesiumCoordUtil.cartesian3ToDegree2(satellite.entity.position.\_value).height : 0) / 6;
                        }, false),
                        material: Cesium.Color.RED
                    }
                });
            }
    
    //动态推送图像
            function addByTime() {
                clear1();
                Cesium.Resource.fetchJson({
                    url: './datas/testfilenew.json'
                }).then(function (jsonData) {
                    if (!jsonData) {
                        return;
                    }
                    let level0 \= jsonData.level3;
                    for (let index = 0; index < level0.length; index++) {
                        const tileData \= level0\[index\];
                        let bbox \= tileData.bbox;
    
                        let imagePath \= tileData.imagePath;
                        let id \= tileData.id;
                        console.log(id);
                        console.log(imagePath);
                        let xnum \= id.split('\_')\[0\];
                        let ynum \= id.split('\_')\[1\];
                        imagePath \= './datas' + imagePath.replace('./', '/');
                        // start(bbox, imagePath);
                        (function (index) {
                            setTimeout(function () {
                                console.log(index, "interval");
                                //addImage(bbox, './datas/aaa.jpg');
                                addImage(bbox, imagePath);
                                let curSillitePos \= Cesium.Cartesian3.fromArray(satellite.routeLine\[index\]);
                                satellite.curRoutePositions.push(curSillitePos);
                                satellite.entity.position \= curSillitePos;
                                satellite.curNadir \= Cesium.Cartesian3.fromDegrees(satellite.nadirs\[index\]\[0\], satellite.nadirs\[index\]\[1\], 0.0);
    
                            }, index \* 300);
                        })(index);
                    }
                }).otherwise(function (error) {
    
                });
    
                addSatellite();
            }
    

    本文转自 https://www.cnblogs.com/dog2016/p/14044005.html,如有侵权,请联系删除。

  • 相关阅读:
    android AudioManager AUDIOFOCUS
    uboot环境变量实现分析
    观察者模式总结
    【BZOJ3270】博物馆 概率DP 高斯消元
    从零開始学android&lt;TabHost标签组件.二十九.&gt;
    怎样在Web项目中的service业务层获取项目根路劲
    TexturePacker 算法
    [leetCode 75] Sort Colors
    无人车可能导致器官捐献者短缺以及吸烟率下降:4星|《无人驾驶,十万亿美元的大饼怎么分?》
    如何寻找颠覆式创新的机会,《创新者的窘境》作者二十年磨一剑:4星|《与运气竞争》
  • 原文地址:https://www.cnblogs.com/hustshu/p/15614312.html
Copyright © 2020-2023  润新知