ZoomTo wmts layer.

75 views
Skip to first unread message

sank...@gmail.com

unread,
Oct 4, 2018, 7:51:28 AM10/4/18
to cesium-dev
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.

Omar Shehata

unread,
Oct 5, 2018, 5:04:28 PM10/5/18
to cesium-dev
I think you can just do viewer.flyTo(layer). Check out this Sandcastle example:

sank...@gmail.com

unread,
Oct 6, 2018, 12:44:57 AM10/6/18
to cesium-dev
Check this  sandcastle link viewer.flyTo is not working properly.What could be the reason.

Omar Shehata

unread,
Oct 7, 2018, 10:35:47 AM10/7/18
to cesium-dev
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:


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! 

Scott Reynolds

unread,
Oct 8, 2018, 7:42:30 AM10/8/18
to cesium-dev
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

Kevin Ring

unread,
Oct 8, 2018, 7:56:25 AM10/8/18
to cesiu...@googlegroups.com
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:



--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Scott Reynolds

unread,
Oct 9, 2018, 3:23:58 PM10/9/18
to cesium-dev
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.

Kevin Ring

unread,
Oct 9, 2018, 8:30:53 PM10/9/18
to cesiu...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages