3

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...

Szymon Łazaruk
  • 63
  • 1
  • 10
  • workaround: replace the line with boundCenterBottom with // super(boundCenterBottom(defaultMarker)); super(defaultMarker, new ResourceProxyImpl(getApplicationContext())); - simply not use the missing method.. – Szymon Łazaruk Mar 12 '12 at 14:14

1 Answers1

2

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

biegleux
  • 13,179
  • 11
  • 45
  • 52
Szymon Łazaruk
  • 63
  • 1
  • 10
  • Dear Szymon. I have quite similar code to yours after trying to make the HelloGoogleMaps example work with OSMdroid. I got the same error-message as you and replaced the line super(boundCenterBottom(defaultMarker)); with what you suggested but it raises the error "item cannot be resolved" and "Implicit super constructor ItemizedOverlay() is undefined. Must explicitly invoke another constructor" How exactly is the setMarkerHotspot method to be used here? – birgit Oct 11 '12 at 12:59
  • @birgit: I think you have to replace `yourPOIOverlayItem.setMarker(boundCenterBottom(yourMarker));` with `yourPOIOverlayItem.setMarkerHotspot(HotspotPlace.BOTTOM_CENTER); yourPOIOverlayItem.setMarker(yourMarker);` – Fabien R Oct 20 '12 at 13:37