JavaME Nokia Maps API:如何显示有关标记单​​击的其他信息? [英] JavaME Nokia Maps API: how to display additional info on marker click?

查看:50
本文介绍了JavaME Nokia Maps API:如何显示有关标记单​​击的其他信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

单击标记时,我需要显示标记的其他信息.我希望找到一种方法来显示带有标记单击的简短描述的弹出窗口(如工具提示),但失败了.
我将MapMarker类用于标记,因为我需要自定义图标.
MapMarker和MapStandardMarker类没有我需要的功能.

I need to display an additional info for a marker when it's clicked. I expected to find a way how to display a popup window (like a tooltip) with a short description on marker click, but failed.
I use MapMarker class for my markers because I need custom icons.
The MapMarker and MapStandardMarker classes do not have the functionality I need.

据我了解,我需要类似 Android MapView气球

As I understand, I need something like Android MapView Balloons

推荐答案

我已经解决了这个问题. 我使用类似于"Meet Me For Dinner"示例应用程序中实现的弹出对话框.在此处.

I've solved the problem. I use the popup dialog similar to the one implemented in "Meet Me For Dinner" sample application. All necessary info can be found here.

我遇到了检测点击标记的问题.为此,我使用了MapDisplay.getObjectAt()方法.但是,该方法似乎没有考虑标记的锚点.因此,我必须为此使用以下变通方法:

I met the problem with detecting a click on marker. For this I used MapDisplay.getObjectAt () method. But it looks like that method doesn't take into account the marker's anchor point. So, I had to use the following work-around for this:

    final MapObject mapObj = mapDisp.getObjectAt ( new Point (
    clickX + m_markerIconSize.getWidth (),
    clickY + m_markerIconSize.getHeight () )
);
if ( (mapObj != null) && (mapObj instanceof MapMarker) ) {

这篇关于JavaME Nokia Maps API:如何显示有关标记单​​击的其他信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆