I have a BillboardCollection where one of the billboards was removed prior to the texture atlas ever being created, so BillboardCollection.update is failing when it tries to load the image for the removed billboard.
I was able to fix the issue by moving the “removeBillboards” call to above the texture atlas creation step. I’m not sure if I’m doing something unsupported so I didn’t submit a pull request, but I figured I’d report the issue. Here’s the update to the function:
BillboardCollection.prototype.update = function(context, frameState, commandList) {
removeBillboards(this);
var billboards = this._billboards;
var billboardsLength = billboards.length;
var textureAtlas = this._textureAtlas;
if (!defined(textureAtlas)) {
textureAtlas = this._textureAtlas = new TextureAtlas({
context : context
});
for (var ii = 0; ii < billboardsLength; ++ii) {
billboards[ii]._loadImage();
}
}
var textureAtlasCoordinates = textureAtlas.textureCoordinates;
if (textureAtlasCoordinates.length === 0) {
// Can't write billboard vertices until we have texture coordinates
// provided by a texture atlas
return;
}
updateMode(this, frameState);
``