Cesiumjs – How to Animating Multipolygons

phpmind-cesiumjs-animate-poygone2

phpmind-cesiumjs-animate-poygone

var viewer = new Cesium.Viewer('cesiumContainer');

var greenCylinder = viewer.entities.add({
    name : 'Green cylinder with black outline',
    position: Cesium.Cartesian3.fromDegrees(-100.0, 40.0, 200000.0),
    cylinder : {
        length : 400000.0,
        topRadius : 200000.0,
        bottomRadius : 200000.0,
        material : Cesium.Color.GREEN.withAlpha(0.5),
        outline : true,
        outlineColor : Cesium.Color.DARK_GREEN
    }
});

var redCone = viewer.entities.add({
    name : 'Red cone',
    position: Cesium.Cartesian3.fromDegrees(-105.0, 40.0, 200000.0),
    cylinder : {
        length : 400000.0,
        topRadius : 0.0,
        bottomRadius : 200000.0,
        material : new Cesium.ColorMaterialProperty(
            new Cesium.CallbackProperty(
                function (time, result){
                    return Cesium.Color.fromAlpha(
                        Cesium.Color.RED,
                        (new Date(time).getTime() % 1000) / 1000,
                        result);
                }, false))
    }
});

viewer.zoomTo(viewer.entities);
Share

Leave a Reply

Your email address will not be published. Required fields are marked *