Overlay vs ItemizedOverlay, your thoughts?

by Mark Wyszomierski » Sun, 25 Oct 2009 01:42:44 GMT


Sponsored Links
 Hi,

I want to draw 20 pins on a MapActivity. Each pin has a small pin
image, but I have to dynamically overlay a small bit of text over each
pin at runtime. Looks like I have two options:

#1) Itemized Overlay
This is the suggested method. I put all my pins in one ItemizedOverlay
object, and that counts as a single Overlay object for my MapView.

#2) One Overlay per pin
Create a separate Overlay instance for each pin I need to render.


The problem I see with using method #1 is that you need to set a
drawable for the item. This would mean that I need to create 20+20
(one for focused/non-focused state each) bitmaps and keep them in
memory for the duration of my app. On the other hand, Overlay lets you
override the draw method so I can do the simple compositing at
runtime.

The other issue with Itemized Overlay - although it handles focus for
you - does it move the focused item to the front of the z-order when
selected?

Thanks

--~--~---------~--~----~------------~-------~--~----~



Overlay vs ItemizedOverlay, your thoughts?

by Loda » Wed, 11 Nov 2009 03:42:36 GMT


 Hi,

I'm newbie to android, but from the example
 http://developer.android.com/intl/es/guide/tutorials/views/hello-mapview.html ,
it seem to me that you do not need to create a drawable for each item.
it's more the opposite.

adn you can always overwrite the methode of OverlayItem...




--


Sponsored Links