I'm currently working on developing apps by using Google maps android API v2. My code is as follows. Suppose map has several markers and zoom up to show all markers in display.
LatLngBuilder.Builder builder = LatLngBounds.builder(); for(Marker m : markers){ builder.include(m.getPosition()); } LatLngBounds bounds = builder.build(); map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 10);
This code is working fine but I want to stop animating when the zoom level reached to 17.0f; It seems map API does not have such method to control zoom level. Does anybody know any idea to solve this problem?
A recent update to the Google Maps API introduces the functions you require:
GoogleMap.setMaxZoomPreference() GoogleMap.setMinZoomPreference()
It still does not prevent the animation from playing, though.
1.4m articles
1.4m replys
5 comments
57.0k users