其他分享
首页 > 其他分享> > 在android中获取最近的街道/道路坐标

在android中获取最近的街道/道路坐标

作者:互联网

javascript中,使用Google maps apis,我们指定了google.maps.TravelMode.DRIVING等选项.我们在Android中有TravelMode的等价物吗?我在android.location.LocationManager或android.location.Criteria中看不到任何内容
我想到了以下选项:

>使用一些TravelMode替代方法,获得近似于最近的街道/道路的坐标.
>或者,(不首选,因为它会很慢)正常获取坐标,然后可能将其发送到某些谷歌api(由于有很多点,这将非常慢)并将坐标校正到最近的街道坐标.或者如果存在一些(谷歌地图)javascript框架,它可以用于获得相应的街道坐标.

EDIT1:

我也调查了this.因此进入了android.location.Geocoder.这个类中的getFromLocation似乎完成了大部分工作.但是,我担心,在获取最近的地址时会有额外的延迟.

解决方法:

如果您指的是Directions Service,那么它在内部使用Google Directions API,如概述中所述:

This object communicates with the Google Maps API Directions Service which receives direction requests and returns computed results.

由于Android还没有原生API,我建议直接使用Directions API.

见我的答案here.

标签:android,google-maps,google-maps-api-3,android-location
来源: https://codeday.me/bug/20190831/1776626.html