问题
I have a cluster of items on an overlay in a mapView.
I know where the top/bottom/left/right most objects are.
I want to use the zoomToSpan() method to zoom onto that area.
What is the proper way to calculate the lat/lng degrees for this method ?
回答1:
I found someone else posting a good solution to this problem here: http://www.anddev.org/zoom_and_span_on_a_cluster_of_points-t464.html
Good luck!
回答2:
This question has been asked before, and there's an excellent answer, with code, here:
Android MapView -setting zoom automatically until all ItemizedOverlay's are visible
回答3:
Wouldn't you want to just use something like this:
mapController.zoomToSpan(overlay.getLatSpanE6(), overlay.getLonSpanE6());
来源:https://stackoverflow.com/questions/2839978/calculating-zoomtospan-degrees-based-on-min-max-lat-lng-to-be-in-the-mapview