I wanted to show a WMS layer that was published on our ArcGIS Server 10.1 as WMS on Cesium. This WMS only covers the State of Victoria, Australia. The BBOX param is:
<BoundingBox CRS="CRS:84" minx="140.961859" miny="-39.136740" maxx="149.976499" maxy="-33.980650"/>
When it was added to Cesium, it wasn't shown at all even if I zoomed in the map to Victoria and closer up. Firebug indicated that it retrieved blank tiles. From there, it was also noticed that the BBOX param for the URL that Cesium generated was far beyond the extent of the WMS. My question is, in one word, why the BBOX was wrongly interpreted.
An example of the URL that was generated is:
http://ARCGIS_SERVER/arcgis/services/GC/LGA_WGS84/MapServer/WmsServer?service=WMS&version=1.1.1&request=GetMap&styles=&format=image/jpeg&layers=0&srs=EPSG:4326&bbox=90,-67.5,112.50000000000003,-45&width=256&height=256&
Is there anybody else that encountered the same issue before? Is it a bug?
Cesium’s WMS is support is pretty simple. It doesn’t access the GetCapabilities service, so it doesn’t know the bounding box of your imagery. If you specify an ‘extent’ property when you construct the WebMapServiceImageryProvider, though, Cesium will restrict itself to only requesting tiles (in the GeographicTilingScheme) that at least partially overlap that extent.
Usually this simple approach doesn’t cause major problems because most WMS servers can provide an image for any extent, even extents that are outside the actual data that is available. The portions of tiles that don’t overlap the data are just blank. As far as I know this is true of ArcGIS Server as well. So I’m not sure why you’re seeing nothing even once you zoom in to Victoria. Is it possible something else is wrong, such as the “layers” parameter?
Were you suggesting specifying the "extent" property with the bounding box for the map? The map being served as WMS only covers Victoria and all outside is blank. That's why it ended up with blank tiles on the Cesium globe as the URL generated had incorrect BBOX param that was provided. It looked as if Cesium looked at place A while I (user) were looking at place B.
If I understand correctly, Cesium has a better support for WMS that covers the entire world than a portion of the world?
Yes, specify the bounding box using the extent parameter when constructing WebMapServiceImageryProvider. Use Cesium.Extent.fromDegrees(west, south, east, north) to construct the Extent.
Cesium does not work the same way as a 2D map. In particular, the last image requested does not necessarily reflect the current view. So just because you see a request for an area other than the one you’re currently looking at does not necessarily mean something is broken.
Cesium has good support for partial-world WMS, with the one caveat that you have to tell it explicitly what part of the world to restrict itself to. Generally this is just a performance optimization to avoid requesting and rendering a bunch of fully-transparent tiles over the rest of the world.