Since the last two weeks i am developing a Navigation App. I want to set an Pointer that is showing me the current Location. How I can make this without using the Marker ? Or did I have to use the Marker ?

有帮助吗?

解决方案 2

Marker startMarker = new Marker(mapView);
        startMarker.setPosition(gp);
        startMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);
        mapView.getOverlays().add(startMarker);
        mapView.invalidate();
        startMarker.setIcon(getResources().getDrawable(R.drawable.iconcurrentlocation));
        startMarker.setTitle("Start point");

with this one u can set immag on yout cuurentLocation and the Important thing is that you have to import this

import org.osmdroid.bonuspack.overlays.Marker;

I hope this helps somebody

其他提示

If you want to display the current location, you can use one of the following osmdroid Overlays:

  • MyLocationOverlay or MyLocationNewOverlay: handling GPS positionning

  • Or DirectedLocationOverlay: GPS position/direction/precision to handle yourself.

By the way, Marker(MapView) should be defined... Your OSMBonusPack lib is probably not installed properly.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top