我正在使用ng-map在 angularjs 中使用谷歌地图。我想在标记拖动结束后获取地址。我试图在他们的文档中找到,但没有找到。他们的文档很好,但没有找到我想要的。尝试后,我得到了纬度并在拖动结束后登录。但我需要地址。所以我要做的是从标记中获取地址,或者我可以将 lat & long 转换为地址。但我没有找到任何地理编码器将经纬度转换为地址的代码。这是我可以从中获取纬度和经度的代码:-
<ng-map>
<marker centered="true" position="current-location" draggable="true" on-dragend="getCurrentLocation()"></marker>
</ng-map>
这是方法:-
$scope.getCurrentLocation = function(){
$scope.pos = this.getPosition();
console.log($scope.pos.lat(),$scope.pos.lng());
}
请帮我在拖动标记后找到地址。