百度地图怎么获取坐标
1个回答
2016-07-31 · 知道合伙人互联网行家
关注
展开全部
用getLocation()方法
var a ;
var i=0;
var latList = new Array();
var longList = new Array();
latList[i] = 115.68596;
longList[i] = 34.49083;
i++;
try {
var listMap = new BMap.Map("containerNone");
listMap.centerAndZoom(point,7);
listMap.enableScrollWheelZoom();
var points = [];
for (i in latList) {
var point = new BMap.Point(latList[i], longList[i]);
points[i] = point;
};
var listGeo = new BMap.Geocoder();
for (i in points) {
listGeo.getLocation(points[i], function(result) {//从数组中取值,得到地理位置
if (result){
addrList.push(result.address);
displayAddress();
}
})
}
} catch(e) {
}
var a ;
var i=0;
var latList = new Array();
var longList = new Array();
latList[i] = 115.68596;
longList[i] = 34.49083;
i++;
try {
var listMap = new BMap.Map("containerNone");
listMap.centerAndZoom(point,7);
listMap.enableScrollWheelZoom();
var points = [];
for (i in latList) {
var point = new BMap.Point(latList[i], longList[i]);
points[i] = point;
};
var listGeo = new BMap.Geocoder();
for (i in points) {
listGeo.getLocation(points[i], function(result) {//从数组中取值,得到地理位置
if (result){
addrList.push(result.address);
displayAddress();
}
})
}
} catch(e) {
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询