Click here to Skip to main content
15,902,492 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello
I am tring to display my current location and put a marker in the map . now only i can see the defult blue dot.

What I have tried:

Override
public void onLocationChanged(Location location) {
    //show our own marker
    mLastLocation = location;
    if (mCurrLocationMarker != null) {
        mCurrLocationMarker.remove();
    }

    //Place current location marker
    LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
    MarkerOptions markerOptions = new MarkerOptions();
    markerOptions.position(latLng);
    markerOptions.title("Current Position");
    markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA));
    mMap.clear();
    mMap.addMarker(markerOptions);
Posted
Updated 31-Dec-18 7:12am
Comments
David Crow 11-Dec-17 8:57am    
The "blue dot" is typically used to indicate your current location, whereas a "pin" is typically used to indicate other locations.

1 solution

Try removing
mMap.clear();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900