GET /mt?n=404&v=w2.10&x=3&y=6&zoom=13 HTTP/1.1
而对卫星地图图片的url像:
GET /kh?n=404&v=5&t=tqtsq HTTP/1.1
就不知它的t参数含义了。
今天看了看地图的.js文件,找到了如下代码,可以计算这个参数,也就可以动态构造出相应的url去批量下载卫星地图了。
代码如下:
<script>
function MapObj()
{
this.x;
this.y;
}
function test()
{
var o = new MapObj();
var ss = document.all("txtPos").value.split(",");
o.x = ss[0];
o.y = ss[1];
var zoom = parseInt(document.all("txtFactor").value);
var ret = cal(o, 17 - zoom);
document.all("txtMess").value = ret;
}
function cal(a,b)
{
var c=Math.pow(2,b);//比例参数, 地图宽度图片数量
var d=a.x;//a is the map object
var e=a.y;
var f="t";
/*
zoom = 13; b = 4; c = 2^4 = 16;
*/
for(var g=0;g<b;g++)//
{
c=c/2; // c / 2
if(e<c) //a.y < c
{
if(d<c)//a.x < c
{
f+="q"
}
else//a.x >= c
{
f+="r";
d-=c //a.x = a.x - c
}
}
else//a.y >= c
{
if(d<c)//a.x < c
{
f+="t";
e-=c //a.y = a.y - c
}
else//a.x >= c
{
f+="s";
d-=c; //a.x = a.x - c
e-=c //a.y = a.y - c
}
}
}
return "t=" + f;
//var h=(a.x+a.y)%this.wa.length;//
//return this.wa[h]+"t="+f
}
</script>
(x,y)<input type=text id="txtPos" value="3,7"><br>
zoom:<input type=text id="txtFactor" value="13">
<input type=button value="check" onclick="test()">
<br>
<input type=text id="txtMess">
function MapObj()
{
this.x;
this.y;
}
function test()
{
var o = new MapObj();
var ss = document.all("txtPos").value.split(",");
o.x = ss[0];
o.y = ss[1];
var zoom = parseInt(document.all("txtFactor").value);
var ret = cal(o, 17 - zoom);
document.all("txtMess").value = ret;
}
function cal(a,b)
{
var c=Math.pow(2,b);//比例参数, 地图宽度图片数量
var d=a.x;//a is the map object
var e=a.y;
var f="t";
/*
zoom = 13; b = 4; c = 2^4 = 16;
*/
for(var g=0;g<b;g++)//
{
c=c/2; // c / 2
if(e<c) //a.y < c
{
if(d<c)//a.x < c
{
f+="q"
}
else//a.x >= c
{
f+="r";
d-=c //a.x = a.x - c
}
}
else//a.y >= c
{
if(d<c)//a.x < c
{
f+="t";
e-=c //a.y = a.y - c
}
else//a.x >= c
{
f+="s";
d-=c; //a.x = a.x - c
e-=c //a.y = a.y - c
}
}
}
return "t=" + f;
//var h=(a.x+a.y)%this.wa.length;//
//return this.wa[h]+"t="+f
}
</script>
(x,y)<input type=text id="txtPos" value="3,7"><br>
zoom:<input type=text id="txtFactor" value="13">
<input type=button value="check" onclick="test()">
<br>
<input type=text id="txtMess">