Wednesday, August 17, 2011

[android-developers] Best way to update location of OverlayItem

I'm writing an application that will have lots of map points, using
the Google Maps API.

The locations of my OverlayItems will be moving and changing, so I'd
like input on best approach to take to update the new locations of the
points as they move. I think that I have only two options (correct me
if you see another approach).

Option A) Hold a master list of the items in a separate synchronized
container, updating them there to maintain synchronization, then re-
create each of the Overlays and re-populate with new/updated
OverlayItems when I want to refresh the map.

Option B) Act directly on the OverlayItems in place (within the
Overlay, with my own synchronization on the my custom Overlay
container), adding/removing/modifying the OverlayItems directly within
the Overlay container as necessary to update the points.

Which approach is best? Are there synchronization issues working with
Overlays directly?

Thanks,
DD

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment