-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
In Cesium 1.31
I have a large number (500+) of quite large (200x100pixel) billboards on my map, and this problem only occurs when the number of billboards is large. The billboard image are canvases that I draw with javascript within the application.
For some reason, the billboards are clipped on the right hand side:

This can be compared to using the same canvas images as icons in Open Layers:

What is really strange, is that I can almost solve the problem if I set the imageSubRegion to be bigger than the canvas itself.
var entity = {
position: Cesium.Cartesian3.fromDegrees(feature.geometry.coordinates[0], feature.geometry.coordinates[1]),
billboard: {
horizontalOrigin : Cesium.HorizontalOrigin.LEFT,
verticalOrigin : Cesium.VerticalOrigin.TOP,
image: ctx,
imageSubRegion: new Cesium.BoundingRectangle(0, 0, ctx.width+2, ctx.height+2),
height: milsymbol.getSize().height,
width: milsymbol.getSize().width,
pixelOffset : new Cesium.Cartesian2(-milsymbol.getAnchor().x, -milsymbol.getAnchor().y)
}
}Now this will be displayed:

Better but not perfect
If we zoom out a lot, we can also see that some of the missing lines from the right hand side is rendered on the left hand side of some symbols:

Notice the vertical lines that shouldn't be there
I figured out that Cesium stores the images in some kind of atlas, but I couldn't find where in the code this was done, and what could be the reason for this error. Please let me know if you need more information about this.
Added:
I tried to revert to Cesium 1.27 to see if #4675 introduced in 1.28 messed anything up, but the result in 1.27 was almost the same as in 1.31.