How to remove default small-sized Google Map marke

2019-09-06 20:11发布

问题:

I am using the below code to draw a marker on Google Maps in a android navigation app.

Marker marker = mMap.addMarker(
  new MarkerOptions().position(current)
                     .anchor(0.5f, 0.3f)
                     .icon(BitmapDescriptorFactory.fromResource(
                             R.drawable.navigation_marker)));

This marker appears successfully, but the default small-sized marker does not get removed. So, eventually I have two markers at the same time. Can you please help on how to remove the default marker?

回答1:

Assuming you mean "the blue dot" or "my location", you will have to completly remove it using GoogleMap.setMyLocationEnabled and use your own LocationClient to update user's current position.