This functionality is very needed if you have a lot of items and you need to delete one of them.

For example: deleting one ATM from ATM’s overlay if user made some action on map.

It can be implemented by creating remove(int) method in your ItemizedOverlay class.
Here is MyItemizedOverlay

!!!Important. You need to call populate() after item deleting.

Here is screenshot of sample Android application:

How to remove specific OverlayItem from MapView ItemizedOverlay in Android.

How to remove specific OverlayItem from MapView ItemizedOverlay in Android.

This application delete map pin with MAX Latitude. Also you can specify your own criteria

Here is Activity code. Take a look in onClick method:

Don’t forget to handle all exceptions 🙂

That’s all.

Download it from github

1 Comment

Nagendra · 5 December, 2012 at 13:16

Thanks hrupin! It works fine 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.