使用getUrl方法在自定义信息窗口中显示位置详细信息

时间:2018-06-14 19:25:47

标签: google-maps android-studio google-places-api

我一直在尝试在自定义信息窗口中显示最近地点的位置详细信息。我已经能够在我的自定义信息窗口中显示搜索结果位置详细信息,但我无法弄清楚如何使此方法生成的位置请求显示在自定义信息窗口中。以下是方法的代码

 private String getUrl(double latitude, double longitude, String nearbyPlace) {
    StringBuilder googlePlacesUrl = new
            StringBuilder("https://maps.googleapis.com/maps/api/place/nearbysearch/json?");
    googlePlacesUrl.append("location=" + latitude + "," + longitude);
    googlePlacesUrl.append("&radius=" + PROXIMITY_RADIUS);
    googlePlacesUrl.append("&type=" + nearbyPlace);
    googlePlacesUrl.append("&sensor=true");
    googlePlacesUrl.append("&key=" + "AIzaSyAvxiw4FVJzY-XGx9mW8fNde4bjvc8mlbo");
    return (googlePlacesUrl.toString());
}

这是我在选择标记时要显示的方式。

this is how I want it to display when i select a marker

以下是该课程的完整代码:https://pastebin.com/0azG69tD

真的需要帮助解决这个问题

0 个答案:

没有答案
相关问题