osmdroid ItemizedOverlay error: The method boundCenterBottom(Drawable) is undefined for the type

怎甘沉沦 提交于 2019-12-10 17:54:54

问题


I'm struggling for some hours now with this problem:

I'm trying to get my itemizedoverlay to work, but I keep getting this error:

The method boundCenterBottom(Drawable) is undefined for the type 

my class:

    public MyDynamicItemizedOverlay(Drawable defaultMarker) {
        super(boundCenterBottom(defaultMarker));

        items = new ArrayList<OverlayItem>();
        populate();

    }

    public void addNewItem(GeoPoint location, String markerText,
            String snippet) {
        items.add(new OverlayItem(snippet, markerText, location));
        populate();
    }

    public void removeItem(int index) {
        items.remove(index);
        populate();
    }

    @Override
    protected OverlayItem createItem(int index) {
        return items.get(index);
    }

    @Override
    public int size() {
        return items.size();
    }

    @Override
    public boolean onSnapToItem(int arg0, int arg1, Point arg2,
            IMapView arg3) {
        // TODO Auto-generated method stub
        return false;
    }

}

I'm using osmdroid-android-3.0.8 and 3.0.7 (tried both). ItemizedOverlay in deed seems not to have such constructor, but ALL of samples I was able to google followed the same pattern...


回答1:


ok, it seem's that the answer to my question is that this method is not implemented in osmdroid and:

item.setMarkerHotspot(HotspotPlace.BOTTOM_CENTER);

should be used insteed



来源:https://stackoverflow.com/questions/9667208/osmdroid-itemizedoverlay-error-the-method-boundcenterbottomdrawable-is-undefi

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