I am working on an Android app and I have two markers i want to place on a google map. The idea is that the user can see the two locations at a glance without having to interact with the map.
LatLngBounds.Builder b = new LatLngBounds.Builder();
b.include(userPos);
b.include(cardPos);
LatLngBounds bounds = b.build();
int width = (int) (0.7 * infoView.getWidth());
int height = (int) (0.7 * mapView.getHeight());
CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, width, height, 5);
googleMap.animateCamera(cu);
The code works fine when the two locations are not very far apart. But when the locations are, for example, Singapore and USA, the two markers cannot be seen together. I have tried to manually set the zoom level to 0 with the same result. Is there any way that I can show the entire world map on the android device at once (i.e without the need for scrolling on the user's part)?
Update: I have tried setting the map to zoom level 0 explicitly. The map does not fit the View I have created. Is it not possible to have the full world view of the map on the screen?