在百度地图api,经纬度怎么转换成百度坐标

2024-11-08 23:06:21
推荐回答(2个)
回答1:

//经纬度坐标圆答
var x = 116.32715863448607;
var y = 39.990912172420714;
var ggPoint = new BMap.Point(x,y);
//坐标转换完之纤敬后的回调函数
translateCallback = function (data){
if(data.status === 0) {
var marker = new BMap.Marker(data.points[0]);
//data.points[0])就是转换后的橘竖慧百度坐标
}
}
//坐标转换
setTimeout(function(){
var convertor = new BMap.Convertor();
var pointArr = [];
pointArr.push(ggPoint);
convertor.translate(pointArr, 1, 5, translateCallback)
}, 1000);

回答2: