【发布时间】:2015-05-03 00:23:20
【问题描述】:
我想将相机移动到适合LatLngBounds 的标记高度。到目前为止,我可以使用以下代码拟合标记的锚点:
LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (Marker marker : markerList) {
builder.include(marker.getPosition());
}
LatLngBounds bounds = builder.build();
int padding = getActivity().getResources().getDimensionPixelSize(R.dimen.home_map_padding); // offset from edges of the map in pixels
cameraUpdate = CameraUpdateFactory.newLatLngBounds(bounds, padding);
mGoogleMap.animateCamera(cameraUpdate);
它产生如下输出:
如您所见,底部有空白空间(这是int padding)。 我希望填充是这样的:
【问题讨论】:
标签: android google-maps-markers google-maps-android-api-2 google-maps-api-2