ItemizedOverlayWithBubble位于标记之上

时间:2014-01-12 16:39:17

标签: android openstreetmap osmdroid itemizedoverlay infobubble

我想把我的ItemizedOverlayWithBubble由OSMdroid放在标记之上,因为现在它在标记上,当它显示我的标记隐藏在气泡后面时,因为它是相同的GeoPoint。什么是正确的方法?

    final ArrayList<ExtendedOverlayItem> items = new ArrayList<ExtendedOverlayItem>();
    ExtendedOverlayItem a = new ExtendedOverlayItem("Hannover", "SampleDescription", new GeoPoint(42.34105549, -3.69639444), this);
    items.add(0, a);
    ItemizedOverlayWithBubble<ExtendedOverlayItem> mMyLocationOverlay = 
            new ItemizedOverlayWithBubble<ExtendedOverlayItem>
            (this, items, mapView);
    mapView.getOverlays().add(mMyLocationOverlay);

非常感谢

2 个答案:

答案 0 :(得分:0)

a.setMarkerHotspot(OverlayItem.HotspotPlace.TOP_CENTER);

如果有人想知道解决方案,这就是解决方案

答案 1 :(得分:0)

如果图标设计暗示了BOTTOM_CENTER热点,则您的解决方案无法正常工作。

使用默认图标时,有一个关于ExtendedOverlayItem上的气泡定位的已知问题。

2个解决方案:

1)为您的项目设置一个图标:     a.setIcon(getResources()getDrawable(R.drawable.my_own_marker));

2)移动到最新版本的OSMBonusPack,v4.2.7,用Marker API替换这个ItemizedOverlayWithBubble / ExtendedOverlayItem,更简单,类似于Google Maps V2。并解决了这个已知问题。

相关问题