Calculating zoomToSpan() degrees based on min/max lat/lng to be in the mapView
-
27-09-2019 - |
Question
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 ?
Solution
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!
OTHER TIPS
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
Wouldn't you want to just use something like this:
mapController.zoomToSpan(overlay.getLatSpanE6(), overlay.getLonSpanE6());
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow