Cloudmade MapType

Topics: Feature Requests
Jun 18, 2011 at 3:17 PM

Hi Radioman,

Cloudmade has real nice styling options for the OpenStreetMap and has a similar tiling system as OpenStreetMap. Anyone can create his own style or use a predefined one.

Is it possible to add this MapType? There are three parameters that should be made public (the first three).

In GMaps.cs in method MakeImageUrl:
case MapType.CloudMade:
    int cloudmadeStyleID = 1;
    string cloudmadeKey = "9c8d5daf12344694ad416589fcf9e9dc"; // demo key of CloudMade
    bool doubleResolution = true;
    char letter = "abc"[GetServerNum(pos, 3)];
    return string.Format("http://{0}{1}/{2}{3}/256/{4}/{5}/{6}.png", letter, cloudmadeKey, cloudmadeStyleID, (doubleResolution ? "@2x" : ""), zoom, pos.X, pos.Y);



Jun 18, 2011 at 3:23 PM

thanks, i'll add after some testing

Jul 2, 2011 at 4:44 PM

done, but i didn't make parameters public because different styles generate different tiles with the same cache id, so if you want custom cloudmade map just copy default cloudmade provider class, change guid, name and style id/whatever and that's it ;}

Jul 3, 2011 at 2:16 PM


Thanks, although I had to reset the timeout.

MyCloudMadeMapProvider myMap = MyCloudMadeMapProvider.Instance;
GMapProvider.TimeoutMs = 30 * 1000;
MainMap.MapProvider = myMap;

Maybe in the future you might think to take parameters into the cache id calculation and then it should be possible to make them public, eg:
readonly Guid id = new Guid(StyleID,0,0,new byte[]{0,1,2,3,4,5,6,7});
Jul 3, 2011 at 2:22 PM

yeah, it's possible