Skip to content

Instantly share code, notes, and snippets.

@Athantor
Created May 20, 2014 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Athantor/4562dafff72c48912e40 to your computer and use it in GitHub Desktop.
Save Athantor/4562dafff72c48912e40 to your computer and use it in GitHub Desktop.
<TMS>
<Title>Bing</Title>
<Layer idx="0">
<Script><![CDATA[
(
function convert(z1, x1, y1)
{
serverpart = 0
serverpart = (serverpart + 1) % 4;
function encodeQuadTree(zoom, tilex, tiley)
{
var tileNum = []
for (var i = zoom - 1; i >= 0; i--)
{
var num = (tilex % 2) | ((tiley % 2) << 1);
tileNum[i] = new String(num);
tilex >>= 1;
tiley >>= 1;
}
return tileNum.join("");
}
return "http://ecn.t" + serverpart + ".tiles.virtualearth.net/tiles/a" + encodeQuadTree(z1,x1,y1) + ".jpeg?g=1036";
}
)
]]></Script>
</Layer>
<Copyright>Microsoft - Bing</Copyright>
</TMS>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment