-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for a minimum level for imagery providers, especially TileMapServiceImageryProvider #913
Conversation
This way the default gdal2tiles.py behavior of only generating tiles up to the first level that has only one tile will not confuse Cesium.
One last thing: it would be nice to get this into b18, assuming no one sees anything scary about it. It's a very simple change that fixes a problem that several people have had when trying to get imagery into Cesium. |
Tests pass. Code is good (not sure why the function is optional, but OK I guess). Works as advertised in the Sandcastle example. |
Add support for a minimum level for imagery providers, especially TileMapServiceImageryProvider
It's optional for backward compatibility because I know of several custom imagery providers out there. Of course, it wouldn't be a difficult breaking change to deal with, so I can go either way on it. |
I'm totally new to Cesium, but I am having trouble with this issue about tile levels with other tile provider formats, such as openstreet. |
@fobetor currently only |
Thank you, I'll try it. I'm not a programmer, so I dont know what final results I will have,,, ;-) |
With imagery covering only a small area of the globe, it's not necessary to generate a complete pyramid of tiles all the way up to level zero, since we'll be down to just one tile at a deeper level. In fact, this is what TMS tile generators like MapTiler and gdal2tiles.py do by default. However, Cesium previously didn't like it if the pyramid did not go all the way to level zero. It would try to request the tiles anyway, generating errors in the console, and then when those requests failed it wouldn't show any imagery at all from that provider until the user zoomed in close enough to request the level that did exist.
This pull requests fixes Cesium to properly support incomplete pyramids. This makes it much easier to generate TMS tile sets for use with Cesium because the MapTiler and gdal2tiles.py default settings will work nicely.
As a defensive mechanism, Cesium will ignore the minimum level specified in the tilemapresource.xml file if honoring it would indicate that there are more than 4 tiles at the minimum level. Our Black Marble imagery is like that currently, and wouldn't work without this check. I think that's because I hacked it up, though.
You can test this pull request by pointing to http://fuzz.homeserver.com/tiles with
TileMapServiceImageryProvider
. The Black Marble Sandcastle example makes it easy to do, but don't forget to remove the explicit maximum level property in that example. See http://fuzz.homeserver.com/tiles/tilemapresource.xml for evidence that not all levels are present. I generated this tile set from a single Landsat 8 scene.