I need to add custom markers to a mapview. First question : is there a standard/default overlay/marker that I can use ? Second : if I've to create a png for the marker overlay, which is the best size for the image ? Do I have to create different images for each screen sizes (ldpi, mdpi, hdpi) ?
Markers are objects of type Marker , and are added to the map with the GoogleMap. addMarker(markerOptions) method. Markers are designed to be interactive. They receive click events by default, and are often used with event listeners to bring up info windows.
For adding a custom marker to Google Maps navigate to the app > res > drawable > Right-Click on it > New > Vector Assets and select the icon which we have to show on your Map. You can change the color according to our requirements. After creating this icon now we will move towards adding this marker to our Map.
ItemizedOverlay
and use OverlayItem
, where you can set you custom drawable via setMarker(drawable)
.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