Hi Hanna,
Sorry for the late reply. Run following sample in SandCastle. First the map will render 400 green billboards. From the drop down select blue to render 400 blue ones. Then select the red billboards. In my computer when I try to render the red billboards it fails with the following Texture atlas error:
Error loading image for billboard: DeveloperError: Width must be less than or equal to the maximum texture size (16384). Check maximumTextureSize.
DeveloperError@http://cesiumjs.org/Cesium/Source/Core/DeveloperError.js:44:19
Texture@http://cesiumjs.org/Cesium/Source/Renderer/Texture.js:87:1
resizeAtlas@http://cesiumjs.org/Cesium/Source/Scene/TextureAtlas.js:200:30
addImage@http://cesiumjs.org/Cesium/Source/Scene/TextureAtlas.js:319:13
TextureAtlas.prototype.addImage/indexPromise<@http://cesiumjs.org/Cesium/Source/Scene/TextureAtlas.js:375:13
fulfilled/p<@http://cesiumjs.org/Cesium/Source/ThirdParty/when.js:196:34
when@http://cesiumjs.org/Cesium/Source/ThirdParty/when.js:59:10
TextureAtlas.prototype.addImage@http://cesiumjs.org/Cesium/Source/Scene/TextureAtlas.js:368:24
Billboard.prototype._loadImage@http://cesiumjs.org/Cesium/Source/Scene/Billboard.js:970:33
Billboard.prototype.setImage@http://cesiumjs.org/Cesium/Source/Scene/Billboard.js:1059:13
.image.set@http://cesiumjs.org/Cesium/Source/Scene/Billboard.js:821:21
BillboardVisualizer.prototype.update@http://cesiumjs.org/Cesium/Source/DataSources/BillboardVisualizer.js:152:17
DataSourceDisplay.prototype.update@http://cesiumjs.org/Cesium/Source/DataSources/DataSourceDisplay.js:269:22
Viewer.prototype._onTick@http://cesiumjs.org/Cesium/Source/Widgets/Viewer/Viewer.js:1478:25
Event.prototype.raiseEvent@http://cesiumjs.org/Cesium/Source/Core/Event.js:147:17
Clock.prototype.tick@http://cesiumjs.org/Cesium/Source/Core/Clock.js:309:9
CesiumWidget.prototype.render@http://cesiumjs.org/Cesium/Source/Widgets/CesiumWidget/CesiumWidget.js:682:31
render@http://cesiumjs.org/Cesium/Source/Widgets/CesiumWidget/CesiumWidget.js:72:25
If it doesn’t generate the error, keep selecting from the drop down until you see the error.
This error is indicating that the texture atlas ran out of space.
Sample:
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
infoBox : false,
selectionIndicator : false
});
function createImage(color) {
viewer.entities.removeAll();
for (var index = 0; index <400;index++)
{
var position = Cesium.Cartesian3.fromDegrees(-123.0744619 + index, 44.0503706, 0);
var entity = viewer.entities.add({
name : color,
position : position,
billboard: {
image: drawImage(color)
}
});
}
}
function drawImage(color) {
// create and draw an image using a canvas
var canvas = document.createElement(‘canvas’);
var context = canvas.getContext(‘2d’);
context.fillStyle = color;
context.fillRect(10, 20, 100, 50);
context.strokeStyle = '#fa00ff';
context.lineWidth = 5;
context.lineCap = 'round';
context.arc(50, 50, 20, 0, Math.PI, false);
context.stroke();
// ... draw image
return canvas;
}
var options = [{
text : ‘Green’,
onselect : function() {
createImage(“green”);
}
}, {
text : ‘Blue’,
onselect : function() {
createImage(“blue”);
}
}, {
text : ‘Red’,
onselect : function() {
createImage(“red”);
}
}, {
text : ‘Yellow’,
onselect : function() {
createImage(“yellow”);
}
}];
Sandcastle.addToolbarMenu(options);
Thanks,
Alberto