Pergunta

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 ?

Foi útil?

Solução

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.

Outras dicas

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 ...
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top