var arr1=[];
$.getJSON('Handler.ashx/ProcessRequest', function (json)
{
var obj;
for (var i=0; i < getJsonLength(json) ; i++)
{
obj = new BMap.Point(json[i].LNG, json[i].LAT);
arr1.push(obj);
}
}
);
function getJsonLength(jsonData)
{
var jsonLength = 0;
for (var item in jsonData)
{ jsonLength++; }
return jsonLength;
}
var polyline = new BMap.Polyline(arr1, { strokeColor: "blue", strokeWeight: 3, strokeOpacity: 0.5 });
map.addOverlay(polyline);
(map实例化过了,我就不在这里贴出来了)
var arr2 = [];
arr3.push(new BMap.Point(x[1],y[1]));
arr3.push(new BMap.Point(x[2],y[2]));
arr3.push(new BMap.Point(x[3],y[3]));
arr3.push(new BMap.Point(x[4],y[4]));
arr3.push(new BMap.Point(x[0],y[0]));
var polyline = new BMap.Polyline(arr2, { strokeColor: "blue", strokeWeight: 3, strokeOpacity: 0.5 })
map.addOverlay(polyline);
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。