This commit is contained in:
Mr.jiang 2024-08-13 20:51:08 +08:00
parent 38469c30c3
commit 853db1af9c
1 changed files with 19 additions and 1 deletions

View File

@ -69,7 +69,25 @@ export function addMarker(map,pointMap,orderList,clickCellBack){
}
});
}
export function amapLocations(map){
AMap.plugin('AMap.Geocoder', function() {
var geocoder = new AMap.Geocoder({
enableHighAccuracy: true,
});
var lnglat = [125.433131,43.878774];
geocoder.getAddress(lnglat, function (status, result) {
if (status === "complete" && result.info === "OK") {
// result为对应的地理位置详细信息
console.log('result=================.',result);
return result;
}else{
console.error('定位失败','失败原因排查信息:'+result.message+result.originMessage);
return result.message;
}
});
});
}
export function amapLocation(map){
AMap.plugin('AMap.Geolocation', function() {
var geolocation = new AMap.Geolocation({