Open AAverin opened 9 years ago
Ok, a little update to the issue. If I remove any layer while it's visible on the screen - map rendering just dies. All that was on the screen at that point keeps displaying, but other tiles no longer show up and load.
The main idea here is to be able to do 2 things:
Latest investigations bring me to this line of VectorTileRenderer if (buckets == null || buckets.vbo == null) { //log.debug("{} no buckets!", tile); return; }
So, what I get after I suddenly remove a large visible layer from the screen - some of the tiles stop drawing, and tiles of the next zoom level also no longer display. Rendering quits on buckets.vbo being null.
To resolve the issue I had to completely reload all other tile layers on screen. This is a workaround, but not a solution, I think.
Any other update on this? I just discovered that if I remove a layer all other layers stop drawing properly.
Another option would be to simply have a way to turn layers on/off instead of removing them but I haven't found any way to do this.
For now I managed the problem by re-loading layers. Some times you even have to force layers refresh by re-loading them for map to start rendering properly. Disabling layers is fine idea and it will help in lots of cases. But the drawback would be that hidden layer would still occupy memory, and in some cases you would want to completely remove layer and all it contents from the map.
How do you reload the layers?
At the moment Map class requires a map base layer to be set via setBaseMap. That map layer seems to be very important, because map theme is applied to that layer specifically.
Now, imagine that situation where you have many maps on the screen. Base map is set to some rough approximation, and other maps are added as VectorTileLayer's on top. The base map being an approximation needs to be removed at some point when we have a higher level of detalization available on another layer.
Right now removing base map breaks the rendering of other layer completely.
Is there a workround? And a general question - any difference between base map and any other tile layer? Why is it so special?