Created
August 18, 2017 19:28
-
-
Save beigirad/1de2a0017d12ef5324fbde7924aa5547 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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