how to kill a Cesium.Viewer???

Hi all,

I have an application where I define a Cesium Viewer:

Cesium.BingMapsApi.defaultKey = ‘Ap35VdTeZwpwt3SS55St9FKBLCdjGmKUrwuIiofndfMP9-NZ6PDKQQs2udzk5LOj’;

console.log("\nCargo SmapViewer3D!!!");

var SmapViewer3D=new Cesium.Viewer(‘SmapViewer3D’);

SmapViewer3D.extend(Cesium.viewerDragDropMixin); //Add basic drag and drop functionality

//Show a pop-up alert if we encounter an error when processing a dropped file

SmapViewer3D.dropError.addEventListener(function(dropHandler, name, error) {

console.log(error);

window.alert(error);

});

I get several data from a database and I show a polygon on the Cesium Viewer with no problems at the very first time.

After that I kill the Cesium Viewer this way:

//delete SmapViewer3D;

//var el = document.getElementById( ‘SmapViewer3D’ );

//el.parentNode.removeChild( el );

document.getElementById(‘SmapViewer3D’).innerHTML="";

var capa=document.getElementById(‘SmapViewer3D’);

capa.style.display=“none”;

capa.style.visibility=“hidden”;

while (capa.hasChildNodes()){

capa.parentNode.removeChild(capa.firstChild);

console.log("\nElimino SmapViewer3D!!!");

}

When I try to show the polygon on the Cesium Viewer, I can see nothing…

:frowning:

ANY IDEAS???

THANKS

Héctor

I mean: when I try to show the polygon on the Cesium Viewer, after defining the Cesium Viewer again, I can see nothing…

Sorry and thanks again…

:wink:

Hi Hector,

Sorry, I’m a little confused about the behavior you want. What would you like to have happen?

Best,

  • Rachel

Hi Hector,

This may be related to what you need to do: https://groups.google.com/forum/#!topic/cesium-dev/sfiuBnBzVew

Thanks,
Gabby