cannot call translateCallback function to report an error
< script type= "text/javascript" >
// API
//GPS
var x = 116.32715863448607;
var y = 39.990912172420714;
var ggPoint = new BMap.Point(x,y);
//
var bm = new BMap.Map("allmap");
bm.centerAndZoom(ggPoint, 15);
bm.addControl(new BMap.NavigationControl());
//gps markerlabel
var markergg = new BMap.Marker(ggPoint);
bm.addOverlay(markergg); //GPS marker
var labelgg = new BMap.Label("GPS",{offset:new BMap.Size(20,-10)});
markergg.setLabel(labelgg); //GPS label
//
//translateCallback
translateCallback = function (data){
if(data.status === 0) {
var marker = new BMap.Marker(data.points[0]);
bm.addOverlay(marker);
var label = new BMap.Label("",{offset:new BMap.Size(20,-10)});
marker.setLabel(label); //label
bm.setCenter(data.points[0]);
}
}
setTimeout(function(){
var convertor = new BMap.Convertor();
var pointArr = [];
pointArr.push(ggPoint);
convertor.translate(pointArr, 1, 5, translateCallback)//translateCallback Uncaught SyntaxError: Unexpected token :
}, 1000);
< / script >
/ / error message