Can you add and remove SPECIFIC overlays/itemized overlays?

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

Can you add and remove SPECIFIC overlays/itemized overlays?

Postby nick_wa » Fri Mar 26, 2010 11:04 am

Essentially I have two overlay classes, one is used to draw a route on a map (should be visible always) while the other is used to display the current position of the user as given by GPS and shown by a small cursor on the map. Each works good by themselves but I cannot get it to work together.

I can only see

-getOverlays
-clearOverlays
-addOverlay

Thereby I can only create one at a time. I know with itemized you can delete certain ones but like I said I always want the route overlay to be visible and be able to draw the users current position with a cursor then when they move, remove that overlay and replace it where they are now all the while the route overlay exists.

Before I pour anymore time into this, can anyone let me know if it is even possible?

Looking for something like: (just pseudocode0

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. //REMEMBER JUST PSEUDOCODE
  3.  
  4.  
  5.  
  6.  
  7.  
  8. MapOverlay mapper = new MapOverlay();
  9.  
  10. CursorOverlay cursor = new CursorOverlay();
  11.  
  12.  
  13.  
  14. add(mapper);
  15.  
  16. add(cursor);
  17.  
  18. invalidateMapview;
  19.  
  20.  
  21.  
  22. Upon a location change{
  23.  
  24.       List overs = getListofOverlays();
  25.  
  26.       overs.remove(cursor);
  27.  
  28.       cursor=new CursorOverlay() <-based on current location
  29.  
  30.       overs.add(cursor);
  31.  
  32.       invalidateMapview;
  33.  
  34. }
  35.  
  36.  
  37.  
  38.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


THANKS IN ADVANCE, would love to find out if possible or not.
nick_wa
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Mar 09, 2010 9:51 pm

Top

Postby nick_wa » Fri Mar 26, 2010 11:16 am

Also with this, I need to be able to have two different route overlays show up on the screen (which I have right now) but the second will need to be periodically deleted and redrawn. Again , the original route overlay will exist for the lifetime of the activity.
nick_wa
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Mar 09, 2010 9:51 pm

Postby nick_wa » Tue Mar 30, 2010 1:26 pm

bump :)
nick_wa
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Mar 09, 2010 9:51 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 4 guests