How to zoom in/out the map view such a way that it cover all markers?
i am reviewing sample code of gmap V2 given in sdk. It lays on sdk\extras\google\google_play_services\samples\maps.
Thanks in advance.
How to zoom in/out the map view such a way that it cover all markers?
i am reviewing sample code of gmap V2 given in sdk. It lays on sdk\extras\google\google_play_services\samples\maps.
Thanks in advance.
Try using LatLngBounds
:
LatLngBounds.Builder builder = new LatLngBounds.Builder();
builder.include(Latlng1);
builder.include(Latlng2);
LatLngBounds bounds = builder.build();
map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 20));
© 2022 - 2024 — McMap. All rights reserved.