Search code examples
androidandroid-mapviewopenstreetmaposmdroid

The constructor Marker(MapView) is undefined ?? Why ??


Marker startMarker = new Marker(mapView); 

When I type this one to create the Marker is "new Marker(mapView); " red lined. and i got this message in my headline -->The constructor Marker(MapView) is undefined<-- What is the problem ?


Solution

  • You have to import the OSMBonusPack, because it contains the right definition of Marker. I had the same issue while following the wiki tutorial.

    import org.osmdroid.bonuspack.overlays.Marker
    

    Make sure to download the BonusPack and include the .jar into lib inside your project and link it inside your project properties.