문제

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

도움이 되었습니까?

해결책

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top