Calculating zoomToSpan() degrees based on min/max lat/lng to be in the mapView

那年仲夏 提交于 2019-12-23 21:31:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!