Mar 30, 2010 at 8:16 PM
Edited Mar 30, 2010 at 8:21 PM
Yes, TiledWmsLayer is deprected en replaced by he TileLayer, which is more generic. TiledWmsLayer is a client for the WMS-C protocol. With the TileLayer you can do the same like this:
string url = "http://labs.metacarta.com/wms-c/tilecache.py?version=1.1.1&request=GetCapabilities&service=wms-c";
var tileSources = TileSourceWmsC.TileSourceBuilder(new Uri(url), null);
var tileSource = new List<ITileSource>(tileSources).Find(source => source.Schema.Name == "satellite-merc");
map.RootLayer = new TileLayer(tileSource);
You can see it in action in the BruTile.Wpf sample app. Some more samples here:
The WMS-C protocol can be used to talk to a tilecache, but it is primarily useful to talk to a WMS directly. I prefer TMS to talk to a tilecache because there can be no rounding errors.
About how to set this up. The usual approach is to put some tilecache tool on the server in front of your WMS. Currently there is no such tool in .net. At our company we have been working with tilecache.py, geowebcache and arcgisserver.
It is possible to create such a server side tool using BruTile but I have no immediate plans to do so. A simple version will not be so hard, but to get it working properly will be quite an effort. What needs to be done is:
- Parse a TMS GET request.
- Create a TileKey from that.
- Lookup if that tile exists in a DbCache.
- If not use a WmsCRequest to retrieve it from the WMS.
- Store it in the DbCache.
- return the tile to the client.