-3

I am developing activity with a map, and markers, and I want to add several actions for each marker, like calculate route or call to a phone, it is possible to add an action like in the notifications?

like this enter image description here

Thanks

Tlaloc-ES
  • 4,825
  • 7
  • 38
  • 84

1 Answers1

-1
public class MarkerDemoActivity extends android.support.v4.app.FragmentActivity
implements OnMarkerClickListener

{ private Marker myMarker;

private void setUpMap()
{
    .......
    googleMap.setOnMarkerClickListener(this);

    myMarker = googleMap.addMarker(new MarkerOptions()
                .position(latLng)
                .title("My Spot")
                .snippet("This is my spot!")
                .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)));
    ......
}

@Override
public boolean onMarkerClick(final Marker marker) {

    if (marker.equals(myMarker)) 
    {
        //handle click here
    }
}

}

hope this code helpful

Yagnesh Lashkari
  • 228
  • 4
  • 15