I think some of the confusion might be coming from the fact that you're expecting too much high-level logic from ItemizedOverlay. ItemizedOverlay is a pretty basic class. You override size() and createItem() to do whatever you want, and then you call populate() anytime you want to update the items in the overlay. populate() will call size() to figure out how many items are present, then call createItem() once for each index 0 - [size() - 1].
How size() and createItem() work, and when populate() gets called, are up to you. From your description, one possibility might be something like this: * Detect map movements by adding an empty Overlay and overriding the draw() method. Use a delay timer to trigger an update after the map stops moving for some threshold of time. * Upon update, get the lat/long span of the MapView, as described, and use it to query your database/server/whatever. * When the results arrive, use them to fill in a member List on your ItemizedOverlay subclass. Then call populate(). Your size() method returns the length of the List; your createItem generates OverlayItems from the data in that List. It's a bit convoluted, no doubt -- some sample code would probably be well-received here. Nonetheless, such an implementation should be possible today. Hope this proves helpful, Steve On Thu, Jun 24, 2010 at 2:16 PM, Mark Murphy <[email protected]>wrote: > On Thu, Jun 24, 2010 at 5:09 PM, Raymond Rodgers > <[email protected]> wrote: > > or from background actions such as receiving new items from > > the server? > > It looks like you can just call populate() again, based on some sample > code a subscriber sent me (on an unrelated issue). However, I have not > played around with this specific scenario much. > > > I'm one of those programmers that always tries be mindful of the amount > of > > memory being used, and although I don't think my app is going to be a > memory > > hog or need to have millions of points on screen at any given time, I > also > > don't want to populate the overlay with items in Florida when the map is > > centered over Hawaii. It was my intention to just load the data necessary > > for what's currently visible to save memory and improve performance > overall, > > but based on what you've told me, maybe I should take another approach. > > I'm just saying that the authors of ItemizedOverlay would not appear > to be worried about the issue. Hence, I'd wait until you see concrete > problems. Premature optimization and all that. Your way of thinking is > delightful, though. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > Android App Developer Books: http://commonsware.com/books > > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- 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

