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 Read more…
UPDATE: Now this is not working. Google changed API. Will post updated tutorial soon Recently a have some task in my Android project. I needed to show route (directions) between two points (geopoins)on google maps in Android. I thought it can be simple task. But It was a lot of Read more…
If your objects which you want to show on the Google Maps in Android have different markers. You need to use lazy loading for markers.
How to do it? It’s very easy. Just use AsyncTask .
Below you can download source code of Android project.
When you start application you can see Google Maps with red default markers. When custom marker loaded the custom marker will replace default marker and update map overlay.
To see map you need specify your own Google Maps API Key in MapView (see main.xml file)
< ?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com .google.android.maps.MapView android:id="@+id/mapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="YOUR_API_KEY"></com> </linearlayout>
Other info you can see in the code. It is simple to understand. Please, add the questions in comments.
Here code of the AsyncTask class