Hi,
I am trying to add an entity in a Cesium.CesiumWidget, through its entities collection but I get the following error:
TypeError: Cannot read property 'add' of undefined
I am actually trying to reproduce the Camera demo from Sandcastle but instead of using the standard Viewer, I try to use the Widget Viewer. Below is my src code:
var viewer = new cesium.CesiumWidget('cesiumContainer');
var west = -77.0;
var south = 38.0;
var east = -72.0;
var north = 42.0;
var rectangle = Cesium.Rectangle.fromDegrees(west, south, east, north);
viewer.camera.setView({
destination: rectangle
});
// Show the rectangle. Not required; just for show.
viewer.entities.add({
rectangle : {
coordinates : rectangle,
fill : false,
outline : true,
outlineColor : Cesium.Color.WHITE
}
});
I use:
- Cesium 1.19
- Windows 10 Enterprise
- Google Chrome 49.0.2623.87 m