Frage

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 ?

War es hilfreich?

Lösung

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.

Andere Tipps

What is the problem ?

It's because the constructor really doesn't exist.

Try this instead :

Marker startMarker = mapView.addMarker(new MarkerOptions().position(markerLatLng));  // markerLatLng is the position for your marker in the map. You can add more options to marker ...
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top