"Is there a limit to the number of Overlays that can be added to a Map?"

Don't think so, but if there is it's definitely more than two.

"My application works fine when I add two overlays, but fails for more than
two"

Fails HOW? What's the stack trace / exception / unexpected behavior?

"Any ideas as to why this is happening?"

Not based on the limited information provided. But make sure any itemized
overlays you're adding have at least one item in them. If you add an
itemized overlay with 0 items, it will crash when you tap the screen (I
found this out the hard way).

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking


On Sat, Nov 28, 2009 at 7:45 PM, Samson Sequeira <[email protected]>wrote:

> Is there a limit to the number of Overlays that can be added to a Map?
>
> My application works fine when I add two overlays, but fails for more
> than two. This is a part of my code
>
> for (int index=0;index<listOfGeopoints.size();index++){
>                  if (color.get(index)==100){
>                  overlayitem = new OverlayItem(listOfGeopoints.get
> (index), "", "");
>                      itemizedOverlay1.addOverlay(overlayitem);}
>
>                 else if (color.get(index)==75){
>                      overlayitem = new OverlayItem(listOfGeopoints.get
> (index), "", "");
>                      itemizedOverlay2.addOverlay(overlayitem);}
>
>                 else if (color.get(index)==50){
>                      overlayitem = new OverlayItem(listOfGeopoints.get
> (index), "", "");
>                      itemizedOverlay3.addOverlay(overlayitem);}
>
>                  else {
>                      overlayitem = new OverlayItem(listOfGeopoints.get
> (index), "", "");
>                      itemizedOverlay4.addOverlay(overlayitem);}
>            }
>
>              mapOverlays.add(itemizedOverlay1);
>              mapOverlays.add(itemizedOverlay2);
>              mapOverlays.add(itemizedOverlay3);
>              mapOverlays.add(itemizedOverlay4);
>
>
> Any ideas as to why this is happening?
>
> --
> 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

Reply via email to