aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeOtherCachersOverlayItem.java
blob: f80664ebfdc4657fbe9dc54fd936e1812e191ddb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package cgeo.geocaching.maps.mapsforge;

import cgeo.geocaching.go4cache.Go4CacheUser;
import cgeo.geocaching.maps.OtherCachersOverlayItem;
import cgeo.geocaching.maps.interfaces.OtherCachersOverlayItemImpl;

import org.mapsforge.android.maps.overlay.OverlayItem;
import org.mapsforge.core.GeoPoint;

import android.content.Context;
import android.graphics.drawable.Drawable;

public class MapsforgeOtherCachersOverlayItem extends OverlayItem implements OtherCachersOverlayItemImpl {
    private final OtherCachersOverlayItem item;

    public MapsforgeOtherCachersOverlayItem(Context context, Go4CacheUser user) {
        super(new GeoPoint(user.getCoords().getLatitudeE6(), user.getCoords().getLongitudeE6()), user.getUsername(), "");
        item = new OtherCachersOverlayItem(context, user);
    }

    @Override
    public Drawable getMarker(int state) {
        Drawable marker = item.getMarker();
        setMarker(marker);
        return marker;
    }

    @Override
    public Go4CacheUser getUser() {
        return item.getUser();
    }
}