I want to set a icon for a marker, but it is too big so i want to scale it down.
MapFragment.this.map.addMarker(new MarkerOptions().position(new LatLng(lat, lng))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.guest_icon)));
This is a duplicate question. See: Change marker size in Google Maps API v2
Simply put, resize the bitmap prior to passing it to the MarkerOptions object you're creating, referencing the newly sized image. It's also worth noting that if it's a fairly large resource, you might want to do the resizing in an AsyncTask or another thread. See this thread for an example: Android , createScaledBitmap slow when creating multiple bitmaps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With