【发布时间】:2014-03-03 05:45:17
【问题描述】:
我无法将 Google Places API 提供的图标添加到标记中。例如,我希望从 Google Places API 的 JSON 返回图标:
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png"
这是我现在在不添加图标的情况下的做法:
for (Place place : mNearPlaces.results) {
LatLng placeLatLng = new LatLng(place.geometry.location.lat,
map.addMarker(new MarkerOptions()
.position(placeLatLng)
.title(place.name));
}
我查看了this post,答案建议使用一些 AsyncTask 下载图像。有没有其他方法可以做到这一点(这种方式似乎很慢)?是否有设置 Google Places API 提供的标记图像的标准方法?
这里是Google Maps Android API v2 Documentation for Markers
谢谢
【问题讨论】:
标签: android google-maps google-maps-markers google-places-api