3

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 ?

Itsik
  • 3,920
  • 1
  • 25
  • 37

3 Answers3

3

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!

Adam
  • 1,076
  • 1
  • 11
  • 24
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

Community
  • 1
  • 1
Mick Byrne
  • 14,394
  • 16
  • 76
  • 91
0

Wouldn't you want to just use something like this:

mapController.zoomToSpan(overlay.getLatSpanE6(), overlay.getLonSpanE6());
Skone
  • 745
  • 4
  • 13