Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何放大/缩小地图视图以覆盖所有标记?
我正在查看 sdk 中给出的 gmap V2 的示例代码。它位于 sdk\extras\google\google_play_services\samples\maps 上。
提前致谢。
尝试使用LatLngBounds :
LatLngBounds
LatLngBounds.Builder builder = new LatLngBounds.Builder(); builder.include(Latlng1); builder.include(Latlng2); LatLngBounds bounds = builder.build(); map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 20));