相关疑难解决方法(0)

118
推荐指数
3
解决办法
8万
查看次数

如何按位置名称查找地址(android google map)

目前我正在开发一个Android应用程序.根据我的收集数据,我有一个位置列表(不是地址) - 只有位置名称(例如餐馆名称,度假村,海滩......),我想在Google Map API上找到每个位置的地址,如下所示图片: 在此输入图像描述

我怎么能这样做?

在这种情况下,我感谢您的帮助.谢谢.

我也在寻找一种方法,但我只找到了从特定地址获得纬度或经度的解决方案.

我实现如下代码但不能返回结果:(

    Geocoder coder = new Geocoder(this);
    List<Address> address;
    try {
    String locationName = "Nhà hàng Blanchy Street, VietNam";
    Geocoder gc = new Geocoder(this);
    List<Address> addressList = coder.getFromLocationName(locationName, 5);
    Address location = addressList.get(0);

    double latitude = location.getLatitude();
    double longitude = location.getLongitude();

        LatLng sydney = new LatLng(latitude , longitude );
        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));
Run Code Online (Sandbox Code Playgroud)

java android google-maps

6
推荐指数
1
解决办法
6807
查看次数

标签 统计

android ×1

google-maps ×1

google-places-api ×1

java ×1