This project has moved and is read-only. For the latest updates, please go here.

TileLayer google map

Topics: SharpMap Project, SharpMap v0.9 / v1.x
May 10, 2010 at 10:35 PM
Edited May 10, 2010 at 10:35 PM

Does anybody know how to use TileLayer with google maps?

I know how to use bing maps, open street, but not yet google maps. Can somebody share example code please?

Thank you for you help


May 11, 2010 at 7:32 AM

There is no specific support for it but it can be configured. You need to fake the user agent and referer so it is not usable in a professional application.

string userAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080404 Firefox/"; 
string referer = "";
var request = new BasicRequest("{1}&s=&y={2}&z={0}&s=");
ITileSource tileSource = new TileSource(new WebTileProvider(request, userAgent, referer, false), new SphericalMercatorInvertedWorldSchema());