使用 osmdroid 为覆盖项目点击自定义信息气泡
我在我的新 Android 项目上使用 osmdroid(因为我希望能够使用离线地图),但在自定义分配给覆盖项目的信息气泡的外观时遇到了许多困难。
现在,我正在使用 ItemizedOverlayWithFocus
叠加层来显示我的项目;查看 其代码,我注意到整个事情都是在 onDrawFinished
方法中绘制的,因此我尝试创建自己的自定义覆盖层来覆盖此方法但这很难得到结果。我希望得到的是这样的东西:
你们是如何设法获得自定义信息气泡的你的项目?
我找到了一些类来为 Google 的 MapView 实现这样的功能(例如 Jeff Gilfelt 的 MapView Balloons),但是osmdroid 没有任何内容。
I'm using osmdroid on my new Android project (since I want to be able to use offline maps) but I encounter many difficulties to customize the look 'n feel of the information bubble assigned to an overlay item.
Right now, I'm using an ItemizedOverlayWithFocus
overlay to display my items; looking at its code, I noticed the whole thing was drawn in the onDrawFinished
method so I tried to create my own custom overlay to override this method but this is pretty difficult to get a result. What I would love to get is something just like this :
How did you guys managed to get a custom information bubble on your projects?
I found a few classes to implement such a thing for Google's MapView (like Jeff Gilfelt's MapView Balloons) but nothing for osmdroid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑:
事情已经给定了。
您可以从
https://github.com/galex/android-mapviewballoons您可以通过“BalloonItemizedOverlay.java”的方法获取选定的气球,如下所示
要设置数据,您可以使用 BalloonOverlayView.java 文件的 setBalloonData 方法,如下所示:
EDIT:
thing is already given.
You can get the code from
https://github.com/galex/android-mapviewballoonsyou can get selected balloon from the method of "BalloonItemizedOverlay.java" as follow
To set the data you can use setBalloonData method of BalloonOverlayView.java file as follow:
您应该查看这个新库,OSM 奖励包。应该完全按照你的意愿去做。
http://code.google.com/p/osmbonuspack/
You should check out this new library, OSM bonus pack. Should do exactly what you want.
http://code.google.com/p/osmbonuspack/