Вопрос

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 ?

Это было полезно?

Решение

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.

Другие советы

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 ...
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top