JavaME Nokia Maps API: how to display additional info on marker click?

喜你入骨 提交于 2019-12-24 08:22:42

问题


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.

As I understand, I need something like Android MapView Balloons


回答1:


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.

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) ) {



回答2:


I worked on Google MID-MAPS, There is no any method to show balloon in MapMarker but you can try with your own method create your own balloon. When user clicks particular position of map you can show your balloon. I never tried this but lets try and let me know also. Thanks



来源:https://stackoverflow.com/questions/8801496/javame-nokia-maps-api-how-to-display-additional-info-on-marker-click

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