function getdata(keyword, moveX,moveY) {
var httpRequest = new XMLHttpRequest();
var moveRight = 300 * moveX;
var moveBottom = 200 * moveY;
var mleft = map.getBounds().minX + moveRight;
var mright = map.getBounds().maxX + moveRight;
var mtop = map.getBounds().maxY + moveBottom;
var mbottom = map.getBounds().minY + moveBottom;
tmpb = "(13369462.283598088,3519223.7651207903;13371226.396249045,3520116.1433819933)";
console.log(tmpb);
var tmpb = "(" + mleft + "," + mbottom + ";" + mright + "," + mtop + ")";
console.log(tmpb);
var loc = window.IPLOC.ipLoc.content.point.x + "," + window.IPLOC.ipLoc.content.point.y;
var myurl = 'https://map.baidu.com/?newmap=1&reqflag=pcmap&biz=1&from=webmap&da_par=direct&pcevaname=pc4.1&qt=spot&from=webmap&wd2=&pn=0&nn=0&db=0&sug=0&addr=0&&da_src=pcmappg.poi.page&on_gel=1&src=7&gr=3&rn=50&ie=utf-8&wd=';
myurl = myurl + keyword + "&t=" + new Date().getTime() + "&b=" + tmpb + "&u_loc=" + loc + "&auth=" + window.AUTH + "&l=18&c=" + window.currentCity.code + "&tn=" + map.mapType;
myurl = encodeURI(myurl);
//myurl='https://map.baidu.com/?newmap=1&reqflag=pcmap&biz=1&from=webmap&da_par=direct&pcevaname=pc4.1&qt=spot&from=webmap&c=179&wd=%E5%9B%BE%E6%96%87&wd2=&pn=0&nn=0&db=0&sug=0&addr=0&&da_src=pcmappg.poi.page&on_gel=1&src=7&gr=3&l=18.091789971874995&rn=50&tn=B_NORMAL_MAP&auth=xbU5HP1zFUUR3VdY2gN6xyEYMbTW%3DUMbuxHTELTHRBLtykiOxAXXwy1uVt1GgvPUDZYOYIZuxtEdwKvUu4kkfkD%3DCPWv3GuxxtXfQEb1UvhgMZSguxzBEHLNRTVtlEeLZNz1%40Db17dDFC8zv7u%40ZPuxztpFJHEf0wd0vyIUFMUFOSCu0kMMxCwt%40%40YwzG&u_loc=13367503,3519953&ie=utf-8&b=(13369462.283598088,3519223.7651207903;13371226.396249045,3520116.1433819933)&t=1594695837120'
httpRequest.open('GET', myurl, true); //第二步:打开连接 将请求参数写在url中 ps:"./Ptest.php?name=test&nameone=testone"
httpRequest.send(); //第三步:发送请求 将请求参数写在URL中
/**
* 获取数据后的处理程序
*/
httpRequest.onreadystatechange = function () {
if (httpRequest.readyState == 4 && httpRequest.status == 200) {
var json = httpRequest.responseText; //获取到json字符串,还需解析
if(window.forjs!=null&&window.forjs.content!=null){
tmpjson=JSON.parse(json);
if(tmpjson.content!=null){
for(var j=0;j<tmpjson.content.length;++j){
var isexit=false;
for(var k=0;k<window.forjs.content.length;++k){
if(window.forjs.content[k].geo==tmpjson.content[j].geo){
isexit=true;
break;
}
}
if (!isexit){
window.forjs.content.push(tmpjson.content[j])
}
}
//window.forjs.content=window.forjs.content.concat(tmpjson.content)
}
}else{
window.forjs = JSON.parse(json);
}
//console.log(window.forjs.content);
}
};
};
window.forjs=null;
var rown=0,colm=0;
var interval = setInterval(function(){
getdata("图文",rown,colm);
rown++;
if(rown>=100){
rown=0;
colm++;
if(colm>=10){
clearInterval(interval);
}
}
},500);
console