?
?
public string TileXYToQuadKey(int tileX, int tileY, int levelOfDetail)
{
StringBuilder quadKey = new StringBuilder();
for (int i = levelOfDetail; i > 0; i--)
{
char digit = '0';
int mask = 1 << (i - 1);
if ((tileX & mask) != 0)
{
digit++;
}
if ((tileY & mask) != 0)
{
digit++;
digit++;
}
quadKey.Append(digit);
}
return quadKey.ToString();
}
string quadkeys = TileXYToQuadKey(xTile, yTile, zoomLevel);
string url = string.Format("http://{0}{1}.ortho.tiles.virtualearth.net/tiles/{0}{2}.{3}?g={4}", "a", 1, quadkeys, "png", 50);
//url为下载地址
|