2

I am working on a vehicle routing algorithm I need to show vehicles on maps with there driver name on top of the label. I have done the marker part it looks like this. enter image description here

However I would like to display driver's name on top of every marker. Can you suggest me any way to do it?

My google maps static api url looks like this

https://maps.googleapis.com/maps/api/staticmap?center=26.900,75.800&zoom=11&size=400x400&markers=color:blue|label:Driver|&markers=color:green|label:Req|26.925571778374632,75.81166033197894|&markers=color:blue|label:others|26.944421737574313,75.8072312248272|26.941722318252367,75.82851178160593|26.909618922760885,75.85079885210592|26.92537722447672,75.85626510000787|26.969253598622025,75.81687986464266|26.933707124740607,75.84999920863306|26.986333832648626,75.88755301718626|26.945330532812793,75.81567681826434|26.942938812152843,75.81989078933901|&markers=color:red|label:Req|26.8983489,75.796436|

Ps: I am using java.

Nitin Jaiman
  • 173
  • 1
  • 12
  • Hope it'll be help you:- 1. http://stackoverflow.com/questions/17837510/map-markers-with-text-in-google-maps-android-api-v2 2. http://stackoverflow.com/questions/14303667/multiple-markers-with-text-on-android-google-maps-api-v2 3. http://stackoverflow.com/questions/14579426/google-android-maps-api-v2-show-marker-tittle-always – InsaneCat Jun 15 '15 at 07:46

2 Answers2

1

I think the best you can do with the Static Maps API v2 is to have different initials and colors for different markers. Like this example.

You may be able to do something with the custom icons too, but it does not seem to be working as far as I can tell.

The best practice here is to implement it using the JavaScript API v3 instead.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
kaho
  • 4,746
  • 1
  • 16
  • 24
0

Is this possible with the version you're using?

@Override
public void onMapReady(GoogleMap map) {
    LatLng sydney = new LatLng(-33.867, 151.206);

    map.setMyLocationEnabled(true);
    map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));

    map.addMarker(new MarkerOptions()
            .title("Sydney")
            .snippet("The most populous city in Australia.")
            .position(sydney));
}

Here is the code in action: https://developers.google.com/maps/documentation/android/

DrZoo
  • 1,574
  • 1
  • 20
  • 31