Skip to content

Instantly share code, notes, and snippets.

@beigirad
Created August 18, 2017 19:28
Show Gist options
  • Save beigirad/1de2a0017d12ef5324fbde7924aa5547 to your computer and use it in GitHub Desktop.
Save beigirad/1de2a0017d12ef5324fbde7924aa5547 to your computer and use it in GitHub Desktop.
Marker setMarker(LatLng location, MarkerType type) {
BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(type.equals(MarkerType.Start) ? R.drawable.marker_start : R.drawable.marker_end);
Marker marker = mGoogleMap
.addMarker(
new MarkerOptions()
.position(location)
// .icon(BitmapDescriptorFactory.defaultMarker(type.equals(MarkerType.Start)?BitmapDescriptorFactory.HUE_AZURE:BitmapDescriptorFactory.HUE_GREEN)));
.icon(icon));
changeMarker(type.equals(MarkerType.Start) ? MarkerType.End : MarkerType.Start);
return marker;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment