Tiles with URL template

Apr 4, 2012 at 7:21 PM
Edited Apr 4, 2012 at 7:22 PM

I've previously used BruTile with SharpMap to get tiles from an OSM tile server.  This worked fine with a little trial and error (or maybe a lot of error).  I'm now trying to pull tile data from a Google Fusion server which will be on a closed network.

In the end I used a tile source as found in another thread on this site with code that looked like this:


var osmTileSource = new TileSource(new WebTileProvider(
    new TmsRequest(new Uri("http://(myserver)"), "png"), 
        new FileCache(@"c:\temp\filecache", "png")), 
    new SphericalMercatorInvertedWorldSchema());


With OSM I was able to create a TmsRequest object which took a URL for the tile server.  It looks like I need to do something similar but with a template for where to put the x, y, and z values in the query string for the Fusion server.  Here are two examples of URLs which are coming out of this server:



Is there a way to form a TmsRequest object which will place the x, y, and z values into a specific position in a template?


Apr 5, 2012 at 1:15 PM

You can use BasicRequest and pass a a format string. Look at the code to know where the X, Y and Z go:


I would like to add an alternative that takes {X}, {Y}, {Z} instead of {0}, {1}, {2}


Apr 5, 2012 at 6:04 PM

Works perfect.  Just replacing TmsRequest with BasicRequest applies the template.  Thanks for the quick reply.