Working with Google Map MyLocation

1. Issue. how to delete markers ?

Click on marker shows title and geolocation. Let’s say long click on a map and we’ll check for marker near that (within .02 for example). To delete marker I have to call Marker.clear() or remove(). I don’t have marker object… I can remove all markers and draw remaining ones.

a.  http://stackoverflow.com/questions/16236439/restoring-map-state-position-and-markers-of-google-maps-v2-on-rotate-and-on

this has good complete code

I found and implemented this code: drag marker to a trash icon. Used this for starting point;http://stackoverflow.com/questions/17460315/delete-map-marker-while-dragged-on-an-imageview-bounds

 

 

2. Issue. Long click starts drag action. However drag Start message has coordinates that are off from original position. I can’t use these coordinates to snap the marker back in place.
After reading I think I have to maintain HashMap of markers with a key that is key to database entries.

3. Other useful sources:

Bunch of sample code but not clear what for and what’s quality, have to download and see.

http://www.androidhive.info/2012/08/android-working-with-google-places-and-maps-tutorial/

 

4. Marker lifecycle collection of sources.
http://stackoverflow.com/questions/16236439/restoring-map-state-position-and-markers-of-google-maps-v2-on-rotate-and-on

http://stackoverflow.com/questions/13762150/how-to-persist-marker-from-google-api-android-v2/13816635

How to instantiate map after rotation etc
http://stackoverflow.com/questions/14114131/how-to-add-overlay-in-google-maps-api-v2-android

 

5. Overlays. Not sure if I have to use Overlays. Seems it’s V1. But I will collect sources
http://stackoverflow.com/questions/6295203/adding-multiple-marker-on-google-map-in-android?rq=1

6. Google sources
https://developers.google.com/maps/documentation/android/marker
https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/package-summary

7. Info Window. If I change content of info window during drag- nothing happens.
http://stackoverflow.com/questions/15503266/dynamic-contents-in-maps-v2-infowindow/15512984#15512984
This might help. InfoWindowAdapter.
Next, this is about creating multiple custom infoWindow . Lot of code.
http://stackoverflow.com/questions/13763545/android-maps-api-v2-with-custom-markers
Next, onMarkerClick show/hide window issues and animaring the camera
http://stackoverflow.com/questions/14055785/android-onmarkerclick-doesnt-call-after-infowindow-hiding-in-googlemap-google-m
Minor next: http://stackoverflow.com/questions/17154027/hide-infowindow-when-clicked-marker-second-time-google-map-android-api-v2 – post answer to return true if I can

8. Map extensions
https://code.google.com/p/android-maps-extensions/

9. Draggable marker example
http://android-er.blogspot.com/2013/01/google-maps-android-api-v2-example_7.html

10: cool code to animate the marker from one geopoint to another:
http://stackoverflow.com/questions/13728041/move-markers-in-google-map-v2-android

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s