-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support quadkey urls (Bing Maps) #65
Comments
Bing Maps Tiles Server uses "quadkeys" to address a specific tile. Currently staticmaps supports the xyz schema only thus does not support Bing Maps, sorry. Feel free to do a PR with C# implementation source public static 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();
} JavaScript implementation source const tileXYToQuadKey = (x, y, z) => {
var quadKey = [];
for (var i = z; i > 0; i--) {
var digit = '0';
var mask = 1 << (i - 1);
if ((x & mask) != 0) {
digit++;
}
if ((y & mask) != 0) {
digit++;
digit++;
}
quadKey.push(digit);
}
return quadKey.join('');
} |
staticmaps@1.9.1 now supports Lines 38 to 46 in 06a73a6
|
Hello
Could you help me to understand? Ho can I use this lib with Bing Maps. I need generate some image and i have Key to Bing Maps
Thanks
The text was updated successfully, but these errors were encountered: