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


Other Threads

1. Supported video formats

Hi,

I'm testing out video playback and not having a great deal of luck
playing back XviD encoded files in the 3rd party Video Player app but
I've also tested out a video designed for iPhone playback (H.264, 483
x 272, 400 kbps video, 112 kbps AAC audio) and although the video
plays perfectly, I don't get any sound.

Any ideas what's up with that?

Cheers,
Strawp
--~--~---------~--~----~------------~-------~--~----~

2. How to scale android:drawableTop/drawableBottom in a TextView to fill parent?

Hi, I am trying to get those nicely looking android list dividers
above and bellow a TextView. So far I am here:

        <TextView
                android:id="@+id/item_footer"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                
android:drawableBottom="@android:drawable/divider_horizontal_bright"
                android:drawableTop="?android:attr/listDivider"
                android:layout_below="@id/item_data_table"
                android:text="@string/next_update" />

        <ImageView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:src="@android:drawable/divider_horizontal_bright"
                android:scaleType="fitXY"
                android:layout_below="@id/item_footer" />

The ImageView makes what I want - the image scales to fill the parent,
but this is not really an ideal solution. In the TextView the
android:drawable* scale horizontally only to the size of what in
android:text. Any ideas how to make the drawables horizontally scale
to the horizontal size of the TextView?

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

3. Need some info about non us/uk developers

4. Network proxy API seems to be confusable.

5. Not able to add account on email client of emulator(sdk r2)

6. Data corruption in Binary SMS

7. Android query