Cesiumjs – How to Animating polyline color

phpmind-cesiumjs-animate-polyline-color1

phpmind-cesiumjs-animate-polyline-color

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.entities.add({
    polyline : {
        positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 39, 250000,
                                                               -125, 39, 250000]),
        width : 5,
        material : new Cesium.PolylineOutlineMaterialProperty({
            color : new Cesium.CallbackProperty(

                function (time, result){
                    return Cesium.Color.fromAlpha(
                            Cesium.Color.RED,
                            (new Date(time).getTime() % 1000) / 1000,
                            result);

             }, false),
            outlineWidth : 2,
            outlineColor : Cesium.Color.BLACK
        })
    }
});

viewer.zoomTo(viewer.entities);
Share

Leave a Reply

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