How to remove default small-sized Google Map marker while building navigation app

你离开我真会死。 提交于 2020-01-06 09:03:52

问题


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.



来源:https://stackoverflow.com/questions/16869192/how-to-remove-default-small-sized-google-map-marker-while-building-navigation-ap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!