I have a MapView, and I call getController().zoomToSpan() on it. My problem with zoomToSpan() is that I want to have a consistent (for example, 15dp) padding outside of the map pins so that they may be selected without needing the user to pinch to zoom out. Currently I am populating zoomToSpan() with the minimum/maximum long/lat of the map pins, so the ones on the edges aren't immediately visible or selectable.
I've considered using a fixed long/lat padding, but I have no guarantee that the map pins won't be excessively close or far away from each other. So although a fixed long/lat padding may work for most cases, it won't work for all cases.
This is how I am currently setting zoomToPan():
mapView.getController().zoomToSpan(MapPoint.convertToGeoPoint(Math.abs(fMinLat - fMaxLat)), MapPoint.convertToGeoPoint(Math.abs(fMinLong - fMaxLong)));
This is an idea I had on how to set it, but I am not sure if it actually solves the problem, or if there is a better way to do it:
mapView.getController().zoomToSpan(MapPoint.convertToGeoPoint((float) (Math.abs(fMinLat-fMaxLat) + (Math.abs(fMaxLat - fMaxLat)) * 0.5)), MapPoint.convertToGeoPoint((float) (Math.abs(fMinLong-fMaxLong) + (Math.abs(fMinLong - fMaxLong) * 0.5))));
I've already checked out these questions, but I'm past the point of making it work; I just want to make it polished: zoomToSpan implementation problem, and Calculating zoomToSpan() degrees based on min/max lat/lng to be in the mapView.