Skip to content

Instantly share code, notes, and snippets.

View omprakashgupta's full-sized avatar

Om Prakash Gupta omprakashgupta

View GitHub Profile
@Ozius
Ozius / GetBitmapDescriptor.java
Last active October 25, 2023 00:46
Get BitmapDescriptor from a VectorDrawable resource for use as an icon on a Google Map Marker. Google Maps SDK for Android.
/*
mMap.addMarker(new MarkerOptions()
.position(new LatLng(latitude, longitude))
.title("Marker Title")
.snippet("Marker snippet")
.icon(getBitmapDescriptor(R.drawable.ic_place_black_48dp)));
*/
private BitmapDescriptor getBitmapDescriptor(int id) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {