Yes, you can call scene.imageryLayers.removeAll() and that will cause the entire globe to be globe.baseColor.
var viewer = new Cesium.Viewer(‘cesiumContainer’);
viewer.scene.globe.baseColor = Cesium.Color.BLACK;
viewer.scene.imageryLayers.removeAll();
However, I just tried this with a TMS provider in Kevin’s imageryWithLimitedExtent branch and there are still issues.
Kevin, here’s the complete Sandcastle example. Am I correct in that nothing should be drawn outside of the rectangle?
var viewer = new Cesium.Viewer(‘cesiumContainer’);
viewer.scene.globe.baseColor = Cesium.Color.BLACK;
viewer.scene.imageryLayers.removeAll();
var west = -75.0;
var south = 28.0;
var east = -67.0;
var north = 29.75;
var layers = viewer.scene.imageryLayers;
layers.removeAll();
layers.addImageryProvider(new Cesium.TileMapServiceImageryProvider({
url : ‘…/images/cesium_maptiler/Cesium_Logo_Color’,
rectangle : Cesium.Rectangle.fromDegrees(west, south, east, north)
}));
// Show a primitive for the imagery layer rectangle.
var polylines = viewer.scene.primitives.add(new Cesium.PolylineCollection());
polylines.add({
positions : Cesium.Cartesian3.fromDegreesArray([
west, south,
west, north,
east, north,
east, south,
west, south
])
});
viewer.scene.camera.viewRectangle(Cesium.Rectangle.fromDegrees(west, south, east, north));