How can i zoomTo wmts after the addition of the wmts file.I’m able to add the wmts file but i’m unable to zoom to the place it got added.To find the place of the wmts I have to rotate the globe always to find the layer where it got added.Is there any way we can zoomTo the layer immediately when the layer got added.
I think you can just do viewer.flyTo(layer). Check out this Sandcastle example:
Check this sandcastle link viewer.flyTo is not working properly.What could be the reason.
Correct me if I’m wrong, but it looks like WMTS doesn’t define a standard bounding rectangle in the XML (or at least, Cesium isn’t currently using it). There’s an open issue for this which I’ll bump to let them know this is still a problem:
https://github.com/AnalyticalGraphicsInc/cesium/issues/4295
In the mean time, you can pass in your own rectangle. If you know of a way to compute a good rectangle for a WMTS tileset a contribution would be much appreciated!
The application coder is responsible for parsing the capabilities documents of OGC services like WMS and WMTS.
Each defined layer in the capabilities document references a TileMatrixSet from which a default bounding box may be determined. Additionally a layer may contain a WGS84BoundingBox element that specifies the limits directly.
I haven’t any experience with the parsers I found by googling.
Hope that helps.
Scott
You might want to take a look at TerriaJS (https://terria.io), which builds on Cesium and has a bunch of higher-level things like this. Here’s the code from TerriaJS that parses out the bounding box from a WMTS GetCapabilities:
https://github.com/TerriaJS/terriajs/blob/master/lib/Models/WebMapTileServiceCatalogItem.js#L514
Thanks Kevin.
I will point out that the schema documents for neither WMTS 1.0 or 1.0.1 require WGS84BoundingBox to be specified and there may also be more than one. I believe the only guaranteed to exist bounding box may be computed from the one or more TileMatrixSet(s) and optional TileMatrixSetLimits(s), the inference being that the data could be sparsely populated.
Thanks, Scott. I didn’t realize there could be more than one - I’m not quite sure what that would mean. In any case, FWIW, we haven’t yet run into a WMTS layer in the wild that has zero or more than one WGS84BoundingBox values. If we did, TerriaJS would not supporting zooming to it.