for (var i = 0; i < GetDate.length; i++)
{
var markerPosition = new AMap.LngLat(CurrJD, CurrWD);
var marker = new AMap.Marker({
//map:mapObj,
position: markerPosition, //基点位置
icon: "../images/caryd.gif", //marker图标,直接传递地址url
offset: { x: -8, y: -34} //相对于基点的位置
});
---A程序点 var info = [];
var MGeocoder;
var address;
//加载地理编码插件
mapObj.plugin(["AMap.Geocoder"], function () {
MGeocoder = new AMap.Geocoder({
radius: 1000,
extensions: "all"
});
//返回地理编码结果
MGeocoder.getAddress(marker.getPosition());
AMap.event.addListener(MGeocoder, "complete",
function (data) {
--B程序点 address = data.regeocode.formattedAddress;
})
});
---c程序点 info.push("目前所在位置 :" + address + "");
}
程序一直A_C_B执行,想A_B_C执行,各位大神啊??