On 06/24/2010 04:28 PM, Mark Murphy wrote:
On Thu, Jun 24, 2010 at 4:12 PM, Raymond Rodgers
<[email protected]> wrote:
From everything that I've seen and have been reading, I'm apparently
supposed to add all my OverlayItems in the constructor, then call
Populate().
Not necessarily. You call populate() once you are ready to being
responding to methods like size() and createItem(). If your stuff is
in a database, you can do your query in your constructor, call
populate(), and create OverlayItems in the calls to createItem().
Ok, thank you, that clears it up considerably.
The problem I have conceptually, is that if I'm pulling these
items from a database (fed by a web site), then when exactly do I update the
items?
How do you define "update the items"?
I should have been more specific, I meant ItemizedOverlays#items (the
ArrayList<OverlayItem> member).
Also, it seems to me that it's a waste of resources to feed it all the items
in advance instead of the ones pertaining to the current location...
Then don't feed it all of the items.
Also, if you think you have a model that will work more efficiently
than does ItemizedOverlay, write an Overlay that uses your custom
approach.
It just seems to me that ItemizedOverlay should be using or have the
option to use a ContentProvider to determine which OverlayItems should
be in memory and on-screen at the time that Draw() is called. The most
probable filtering would be based on whether the item is within the
latitude/longitude bounds of the screen since that information is
readily determinable within the Overlay class. While I'm a relatively
experienced programmer, I'm new to Android so I'm just trying to figure
out how to do this The Right Way (tm). :-) If there is such an animal,
of course.
Raymond
--
Raymond Rodgers
http://www.badlucksoft.com/
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en