1. A concise explanation of the problem you're experiencing.
I am trying to display a static grid onto the globe. The problem is that for large numbers of polylines, the rendering is very slow.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
I can't actually put my code in here, but what I am doing is loading the posits into a geojson and then loading that as a data source.
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I need a static grid for measurements. The ImageryProvider scales the grid dynamically, so I cannot use this. I also can't overlay an image because the line width has to still scale.
4. The Cesium version you're using, your operating system and browser.
Cesium 1.21, Windows 10, Google Chrome
I think a custom imagery provider is the way to go from a performance standpoint. Can you create a custom imagery provider which modifies GridImageryProvider.js for your specific case where it shouldn’t scale the grid?
That seems like a really good idea. I was trying to figure out where the grid gets updated. Is there a zoom action listener that does this and do you know where I can find this? Thanks!
There is a Camera.changed event you can subscribe to, and you can then read Camera.positionWC and get the distance from the center of a globe tile to determine how “zoomed” the grid is. However, I don’t think that’s the approach typically taken in this case. Since the scene is 3D, there is no uniform zoom level for all the globe tiles. Instead the globe’s quadtree will determine what levels of tiles to show where on the globe depending on the position of the camera in the scene, and request that tile image from the imagery provider. But if you need finer grained control, you could probably subscribe to that event and re-draw the image for the tiles shown.