zulkic / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create own MyDynamicItemizedOverlay extends ItemizedOverlay<OverlayItem>
2. use osmdroid-android-3.0.8 or 7
3. use the source below:

What is the expected output? What do you see instead?

"The method boundCenterBottom(Drawable) is undefined for the type 
MapActivity.MyDynamicItemizedOverlay"

What version of the product are you using? On what operating system?

osmdroid-android-3.0.8 or 7

Please provide any additional information below.

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 
MapActivity.MyDynamicItemizedOverlay"

source:

public class MyDynamicItemizedOverlay extends ItemizedOverlay<OverlayItem> {

        private ArrayList<OverlayItem> items;

        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;
        }

    }

Original issue reported on code.google.com by Szymon.L...@gmail.com on 12 Mar 2012 at 1:47

GoogleCodeExporter commented 9 years ago
You are getting that error because "boundCenterBottom" a Google Maps feature 
that is not supported by osmdroid.

osmdroid's equivalent is:
"item.setMarkerHotspot(HotspotPlace.BOTTOM_CENTER);"

Original comment by felipena...@gmail.com on 4 Apr 2012 at 5:00

GoogleCodeExporter commented 9 years ago
Please follow felipenamal's advice and use the item.setMarkerHotspot() method 
in osmdroid.

Original comment by kurtzm...@gmail.com on 6 Apr 2012 at 7:28