views:

131

answers:

1

Hi

Can someone tell my when to use Overlay or when to use ItemizedOverlay class!

What are differences between this two classes?

Draw methods do the same thing?

Can I use only ItemizedOverlay class in my project or I must use and Overlay as base class!

Thanks

+2  A: 

Overlay is a general overlay. ItemizedOverlay is a subclass that makes it easier to create an overlay that is a discrete series of marked points on the map. So, if you are trying to show a bus route, or shade a region, or something like that, Overlay is the class you want. If you are trying to show a collection of restaurants, or churches, or whatever, ItemizedOverlay works.

Note, though, that ItemizedOverlay is designed for modest numbers of points (e.g., dozens). If you have a large number of points, you may need to create your own Overlay just for performance reasons.

CommonsWare
CommonsWare, thanks for your helpI want to draw route, but also on this route I want to add draggable markers. Every line between two points should I put in different Overlay Item ?? Can you please give me idea
Jovan
@Jovan: you will probably need two overlays, one `Overlay` for the route and one `ItemizedOverlay` for the markers. Here is a project demonstrating drag-and-drop markers: http://github.com/commonsguy/cw-advandroid/tree/master/Maps/NooYawkTouch/
CommonsWare