I'm trying to use mapsforge to do a display maps on my phone.
Currently I'm having slight problems with regards to adding an overlay to display pins. This is the code that gives an error:
ArrayItemizedOverlay itemizedOverlay = new ArrayItemizedOverlay(defaultMarker, true);
myOpenMapView.getOverlays().add(itemizedOverlay);
getOverlays() will return List, as stated here
This line gives this error:
"The method add(Overlay) in the type List<Overlay> is not applicable for the arguments (ArrayItemizedOverlay)"
which is what I don't really understand is why the .add() method is invalid in this case, since ArrayItemizedOverlay class is a subclass of the Overlay class.
These are the class definitions and I hope someone can enlighten me what I can do so that the .add() method will accept the object.
public class ArrayItemizedOverlay extends ItemizedOverlay<OverlayItem> {
//codes....
}
public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay {
//codes...
}
Feel free to point out any missing information which you may need, thanks!