How do I set the marker size. Can anyone tell me?
It's happening because the icon you are using as a marker is bigger in size.So,You can first convert it into Bitmap and change its size and then use that bitmap in as a custom marker. For example I have made a method which resizes your bitmap and returns the resized bitmap.
public Bitmap resizeBitmap(String drawableName,int width, int height){
Bitmap imageBitmap = BitmapFactory.decodeResource(getResources(),getResources().getIdentifier(drawableName, "drawable", getPackageName()));
return Bitmap.createScaledBitmap(imageBitmap, width, height, false);
}
Then call this method in googleMap.addMarker()
googleMap.addMarker(new MarkerOptions()
.title("New Marker").position(yourGivenPosition).icon(BitmapDescriptorFactory.fromBitmap(resizeBitmap("your drawable name",72,64))));
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