Google maps 使用PlaceID Android的谷歌地图标记

Google maps 使用PlaceID Android的谷歌地图标记,google-maps,google-maps-markers,google-maps-android-api-2,Google Maps,Google Maps Markers,Google Maps Android Api 2,如何使用place_id而不是经纬度坐标创建位置标记 public void onMapReady(GoogleMap map) { LatLng sydney = new LatLng(-34, 151); //I want to use the place_id to place in of the Latitude and Longitude map.addMarker(new MarkerOptions().position(sydney).title(" Sy

如何使用place_id而不是经纬度坐标创建位置标记

public void onMapReady(GoogleMap map) {
    LatLng sydney = new LatLng(-34, 151);
    //I want to use the place_id to place in of the Latitude and Longitude 
    map.addMarker(new MarkerOptions().position(sydney).title(" Sydney"));    
    map.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}

我认为mapsapi不支持这种功能

相反,您需要对给定的PlaceID实现反向查找,以返回Lat Long并将其传递到addMarker函数中


如果您首先使用Places API获取Place ID,查询Place详细信息将提供更丰富的位置信息-

谢谢我的选择。虽然我认为这是可以完成的,而不是反向查找。如果您从LatLong查询中获得了PlaceId,请忽略步骤1-但是您只能从具有有效PlaceId(AFAIK)的呼叫中获取地点详细信息