如何在 Blackberry MapField 中显示多个位置?
我可以使用坐标或经度和纬度显示一个位置,但我不知道如何在黑莓 MapField 中显示多个位置。如果可能,请与我分享如何执行此操作。
I can able to show one location using co ordinates or longtitude and latitude but i dont know how to show more than one location in the blackberry MapField.If is it possible pls share with me how to do this..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
与 如何在 BlackBerry Map 中显示我们自己的图标?< /a>.
将坐标数组传递到自定义 MapField,定义位置点的位图,并在自定义 MapField Paint() 方法中为每个坐标绘制它。
请记住放大/缩小 CustomMapField 以便最适合所有位置点。
实现示例
让我们用自定义位图图标(带有黑色边框的黄色圆圈)显示利物浦谢菲尔德和伦敦。自定义MapField的代码:
使用示例:
Same way as How to show our own icon in BlackBerry Map?.
Pass an array of Coordinates into custom MapField, define a bitmap for location point and paint it for each Coordinate in custom MapField paint() method.
Remember to zoom in/out CustomMapField for best fit of all location points.
Sample of implementation
Lets display Liverpool Sheffield and London with custom bitmap icons (yellow circle with black border). Code for custom MapField:
Sample of use:
一个有效且可能更简单的选择是通过 Monits https://github.com/Monits/blackberry-commons
它包含 BB 应用程序中的几个常见功能,并且与 BB 4.6 兼容。 1+
除此之外,它还提供了一个地图字段,能够在其顶部添加和显示标记(有焦点和无焦点),并且可以选择“打开”它们。这使得 API 与 iPhone 或 Android 等其他智能手机上的 API 更加相似。
文档非常好,wiki 甚至还有关于如何实现它的教程https:// /github.com/Monits/blackberry-commons/wiki/CustomMap
A valid and probably simpler option would be to use this open source library by Monits https://github.com/Monits/blackberry-commons
It contains several common functionality found in BB applications and is compatible for BB 4.6.1+
Among other things, it provides a map field with the ability to add and display markers on top of it, with and without focus, and optionally "open" them. This makes for an API much more alike that found on other smart phones such as iPhone or Android.
The documentation is pretty good, and the wiki even has a tutorial on how to achieve it https://github.com/Monits/blackberry-commons/wiki/CustomMap