In my map , I have some list of Markers, now I need to achieve the output as like below
i.e. marker with index number.
I have searched over google but didn't get any solution, Please help me to get an idea to implement this.
In my map , I have some list of Markers, now I need to achieve the output as like below
i.e. marker with index number.
I have searched over google but didn't get any solution, Please help me to get an idea to implement this.
I have made a very flexible and interesting hack to achieve whatever kind of marker you want.
What I do is,
Create an XML Layout file and design it the way you want your marker to appear. For example in your case it is going to be a Green Marker image with a TextView on it.
Set the values of TextViews as per requirement.
Convert the Layout file to an image and get BitmapDescriptor Object.
Create a custom marker by using the image you just created.
The benefit of such view over Info Window is that you can open window for multiple markers at same time. As in InfoWindow you can open it only for one marker at one time.
For custom marker:
custom image
anddraw
anindex number
in top of thatimage
For
Marker Window
:You can create a custom
xml
file that containsImageView
andTextViews
:Something like
customMapView.xml
:After you initialize
Markers
you callsetInfoWindowAdapter
and inflateyour custom view
. Something like: