문제

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