Android MapView:ItemizedOverlay 的 ZoomToSpan 方法存在问题
我使用以下代码来缩放以查看 MapView 上的所有点:
mMapController.zoomToSpan(myOverlay.getLatSpanE6(), myOverlay.getLonSpanE6());
它可以工作,但它只考虑点而不考虑覆盖,因此给了我以下内容结果:
有办法解决这个问题吗?我想手动向 getLatSpanE6()/getLonSpanE6() 添加/减去一些纬度/经度,但这会很脏,而且我不知道应该添加/减去多少。有人有什么想法吗?
谢谢!
I am using the following code to zoom to view all point on a MapView:
mMapController.zoomToSpan(myOverlay.getLatSpanE6(), myOverlay.getLonSpanE6());
It works, except a problem that it only considers points but not overlays, thus gives me the following result:
Is there anyway to deal with this? I was thinking that manually add/subtract some latitude/longitude to/from getLatSpanE6()/getLonSpanE6(), but this is going to be dirty and I don't know how much should I add/subtract. Does anyone have any ideas?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅我的回答此处
您唯一需要做的不同是考虑覆盖项目的高度及其宽度。
IE
伪代码 :
Refer to my answer here
The only thing you have to do different is take into account the height of the overlay item and its width.
i.e
pseudo-code :
根据您的要求设置给定方法的值,如果您希望答案更清晰,那么首先您应该阅读与 givn 方法相关的 android 的谷歌文档,然后您就明白了。我希望您能使用它解决您的问题。
set the value of the given method according to your requirement if you want more clarity in the answer then first you should read the google documentation for android related to the givn method then you understand. I hope you got solution of your problem using it.