how to use postinvalidate to update the overlay on mapview?

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

how to use postinvalidate to update the overlay on mapview?

Postby hitendra » Mon Jan 10, 2011 7:25 am

hi,

i am just trying to remove the old overlay and add the new one.but old doesnt removed.
below is my code for the method from where i am updating my overlay on the mapview within my MapActivity class.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     public void drawOverlay(GeoPoint point)
  2.     {
  3.         list_overlay=mapView.getOverlays();
  4.         if(list_overlay.size()>0)
  5.         {
  6.                 for(Iterator<Overlay> iterator=list_overlay.iterator();iterator.hasNext();)
  7.                 {
  8.                         iterator.next();
  9.                         iterator.remove();
  10.                 }
  11.         }
  12.         OverlayItem overlay_item=new OverlayItem(point,"Address","This is snippet");
  13.         map_overlay.addOverlay(overlay_item);
  14.         list_overlay.add(map_overlay);
  15.         mapView.postInvalidate();
  16.     }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

can anyone tell me what is the wrong with this code?
thankx
hitendra
Freshman
Freshman
 
Posts: 4
Joined: Fri Dec 31, 2010 9:53 am

Top

Return to Map Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests