I'm working on a map that has multiple markers on it. These markers use a custom icon.
Is there a way to add numbers to these icons ?
edit: here is an example of what I want to do
I want to generate these icons programmatically and add them to the map.
Thanks
first, you can use library.
or, you should implement custom icons into drawable folder and put code below.
MarkerOptions markeropt = new MarkerOptions();
markeropt.snippet("Snippet");
markeropt.icon(BitmapDescriptorFactory.fromResource(R.drawable.custom_icon));
this solution would be helpful! here is a link's snippet.
Bitmap.Config conf = Bitmap.Config.ARGB_8888;
Bitmap bmp = Bitmap.createBitmap(200, 50, conf);
Canvas canvas = new Canvas(bmp);
canvas.drawText("TEXT", 0, 50, paint); // paint defines the text color, stroke width, size
mMap.addMarker(new MarkerOptions()
.position(clickedPosition)
//.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker2))
.icon(BitmapDescriptorFactory.fromBitmap(bmp))
.anchor(0.5f, 1)
);
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