var lyrRemoved = true;
var pLayers= ;
for(var t=0;t<48;t++){
var imgurl = ‘http://localhost/images/’+t+’.png ’;
var pLayerProvider = new Cesium.SingleTileImageryProvider({
url: imgurl,
rectangle: Cesium.Rectangle.fromDegrees(80, 20, 120, 40)
});
pLayers.push(new Cesium.ImageryLayer(pLayerProvider, { alpha: 0.8 }));
}
setInterval(function() {
if (lyrRemoved) {
lyrRemoved = false;
var layers = scene.imageryLayers;
var previousLayer;
if (flg > 0) {
previousLayer = pLayers[flg - 1];
} else {
previousLayer = pLayers[pLayers.length - 1];
}
setTimeout(function() {
layers.remove(previousLayer, false);
lyrRemoved = true;
}, 150);
layers.add(pLayers[flg]);
flg++;
if (flg >= 48) {
flg = 0;
}
}
}, 60);
the screen always flushed,Is there any solution?
hannah
September 27, 2016, 2:27pm
2
I’m sorry, I don’t know what you’re asking. Can you please elaborate?
-Hannah
I wana make a animation by pictures,but the first tile of the previous picture always rendered.finally,I use the code like this,the problem still happened.
setInterval(function() {
if (lyrRemoved) {
lyrRemoved = false;
var layers = scene.imageryLayers;
var previousLayer;
if (flg > 0) {
previousLayer = pLayers[flg - 1];
} else {
previousLayer = pLayers[pLayers.length - 1];
}
var listener=scene.globe.tileLoadProgressEvent.addEventListener(function(event) {
if (event === 0) {
var result=layers.remove(previousLayer, false);
listener();
lyrRemoved = true;
console.log(“all tiles loaded”);
}
});
layers.add(pLayers[flg],1);
flg++;
if (flg >= 48) {
flg = 0;
}
}
}, 60);
在 2016年9月27日星期二 UTC+8下午10:27:22,Hannah Pinkos写道:
hannah
September 30, 2016, 3:04pm
4
Sorry, I don’t know of any good way to accomplish this. Maybe someone else has done something similar and will have some pointers.
Best,
Hannah
thank for your help.
在 2016年9月30日星期五 UTC+8下午11:04:11,Hannah Pinkos写道:
Hi, Liu
Any progress on this topic?