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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to