NG-地图拖动标记后得到的地址 [英] Ng-map get address after dragging marker

查看:138
本文介绍了NG-地图拖动标记后得到的地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 NG-地图使用在angularjs谷歌地图。我想获得标记地址safter阻力结束。我曾尝试自己的文档中找到,但并未发现了点。他们的文档是好的,但没有找到我想要的。尝试之后我得到了纬度和日志拖动结束后。但我需要的地址。所以我要做的就是从标记获取地址,或者我可以转换纬度和放大器;长时间来解决。但我没有找到任何code为地理codeR转换Lat Long网来解决。下面是从code在那里我可以纬度和放大器;长: -

I am using ng-map to use google map in angularjs. I want to get address safter drag end of marker. I have tried to find in their documentation but did not found for that. Their documentation is good but did not found what i wanted. After trying i got the lat and log after drag end. But i need the address. So what i have to do is to get address from marker or i can convert lat & long to address. But i did not find any code for geocoder to convert lat long to address. Here is the code from where i can the 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());
}

请帮我拖动标记之后找到的地址。

Please help me to find the address after dragging the marker.

推荐答案

有一个在线的指令,做的反向地理编码。这是伟大的,你可以在code直接使用服务转换的目的纬度/标记拖动到一个有效的地址后,LNG获得的。

There is a directive online that does the reverse geocoding. It is great and you can directly use in your code to serve the purpose of converting the lat/lng obtained after dragging the marker to a valid address.

请看看这个教程具有指令code了。

Please take a look at this tutorial that has the directive code too.

这篇关于NG-地图拖动标记后得到的地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆