【问题标题】:Getting business names or landmarks from lat/long in Android在 Android 中从 lat/long 获取企业名称或地标
【发布时间】:2011-05-05 09:02:13
【问题描述】:

好的,所以我一直在寻找相当长的时间。

我的新位置有一个纬度/经度。地理编码器的 getFromLocation 从纬度/经度返回一定数量的地址,这一切都很好。然后我把它放入一个填充微调器的适配器中......也很完美。

我现在需要的是获取公司名称而不是地址。我更喜欢使用 lat long 并在一定距离内获取所有业务,因为并非从 getFromLocation 返回的所有地址都是完整的。有些只是社区或国家。

这个链接做得很好,虽然我还没有实现它。在我看来,对于像谷歌这样的大人物来说,这似乎是相当标准的处理能力。

http://www.smnirven.com/?p=39

提前致谢。

public void getFeature() {
    double lat = currentLocation.getLatitude();
    double lon = currentLocation.getLongitude();
    Geocoder gc = new Geocoder(getBaseContext(), Locale.getDefault());

    try {
        List<Address> tmpfeatures = gc.getFromLocation(lat, lon, 15);
        Iterator itr = tmpfeatures.iterator();
        while (itr.hasNext()) {
            featuresAdapter.add(((Address) itr.next()).getFeatureName().toString());
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
}

【问题讨论】:

    标签: android google-maps-api-3 geocoding


    【解决方案1】:

    Google 地方信息 API。注册开发者预览版。

    https://developers.google.com/places/documentation

    【讨论】:

      猜你喜欢
      • 2019-02-09
      • 2015-01-25
      • 1970-01-01
      • 2013-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-09
      • 1970-01-01
      相关资源
      最近更新 更多