0

I have set my map to zoom to user's current location on start (the blue dot thing). I set it to show by this:

map.setMyLocationEnabled(true);

But when I clicked on this marker there is no title (iOS by default displays "Current Location"). How can I set the title for the blue current location marker? Thank you.

JessThePest
  • 155
  • 2
  • 11
  • 1
    It's not a marker. If you want to add a marker with an info window, take a look here: http://stackoverflow.com/questions/30253123/blue-dot-and-circle-is-not-shown-on-mylocation-using-android-fused-location-api – Daniel Nugent Nov 01 '15 at 07:49

1 Answers1

0

You can always use the function .title() of MarkerOptions class for displaying title of a Marker.

Eg:-

MarkerOptions mOptions=new MarkerOptions();

mOptions.title('My_Marker_Title');

mOptions.position('My_Marker_Position'); // pass the current location here
mOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.RED)); 
//default color is red here. You can change it.

Marker myMarker = map.addMarker(mOptions);

For My_Marker_position:-

LatLng ltlng=new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude());

and use mOptions.position(ltlng);

You can use many functionalities with your marker too. Like adding snippet, making it draggable etc.

To show your marker info use:-

myMarker.showWindowInfo();

Refer:-https://developers.google.com/android/reference/com/google/android/gms/maps/model/MarkerOptions

Mrigank
  • 522
  • 4
  • 13