Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace blue dot with my icon on google maps v2 in android?

I am trying to replace blue dot (which shown current location on maps) with my own icon on Google maps v2. I have tried below, none worked.

  • Android Maps API v2 Change MyLocation Icon
  • Maps V2 myLocation blue dot callback
  • Disable center button in MyLocation at Google Map API V2

Should look like this this

Below did not work

Bitmap b = BitmapFactory.decodeResource(getResources(),
        R.drawable.location_arrow1);
googleMap.addMarker(new MarkerOptions().position(myPosition)
        .title(getIntent().getStringExtra("first_name"))
        .icon(BitmapDescriptorFactory.fromBitmap(b)));
like image 759
duggu Avatar asked Dec 26 '22 02:12

duggu


1 Answers

You will have to stop using GoogleMap.setMyLocationEnabled and write a bit more code, including receiving location updates on your own and adding Circle for accuracy.

like image 179
MaciejGórski Avatar answered Apr 27 '23 01:04

MaciejGórski