Handle the Overlay when it is gone from screen

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

Handle the Overlay when it is gone from screen

Postby burakkilic » Thu Oct 01, 2009 11:17 am

Hi,
I want to handle the event of the overlay when it is gone from the MapView screen, I mean when when we cannot see it.
burakkilic
Developer
Developer
 
Posts: 37
Joined: Thu Oct 01, 2009 10:24 am

Top

Postby andreleitao » Fri Oct 02, 2009 2:30 pm

Hi,

what exactly did you mean? A MapView contains the method getOverlays(). Do you want to manipulate overlays that are not in this List (getOverlays())? It is still a bit confusing. Can you explain the problem better?
andreleitao
Experienced Developer
Experienced Developer
 
Posts: 70
Joined: Tue Mar 10, 2009 9:56 pm
Location: Recife - Brazil

Postby burakkilic » Fri Oct 02, 2009 8:43 pm

For example: Lets say we have 3 addresses overlaid on the screen.It means 3 instances of overlay items. Lets say we go to the west, the most east overlays instance has to be destroyed. And maybe more addresses in the west has to be seen. I want these becouse I dont want to exhaust the system with putting the all overlays at the same time.I wish it is a little bit more clear now.
burakkilic
Developer
Developer
 
Posts: 37
Joined: Thu Oct 01, 2009 10:24 am

Postby andreleitao » Mon Oct 05, 2009 1:37 am

When your new geo points are updated, is recommended to clear all map overlays and add the newer overlays to it. But be carefull if you want to control the visualization of pins individually... clear a single Overlay from map overlays list can be dangerous, because MapView is iterating over its overlays list, and it can throws an unexpected ConcurrentModificationException.

I do recommend:

1- get all your overlays
2- add them to MapView overlays
WHEN PINS MUST BE UPDATED:
3- remove all MapView overlays
4- get all your overlays
5- add them to MapView overlays

Remember:
map overlays are drawn automatically.


Has this answer helped you?
andreleitao
Experienced Developer
Experienced Developer
 
Posts: 70
Joined: Tue Mar 10, 2009 9:56 pm
Location: Recife - Brazil

Postby burakkilic » Mon Oct 05, 2009 6:44 am

Thank u very much
burakkilic
Developer
Developer
 
Posts: 37
Joined: Thu Oct 01, 2009 10:24 am

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 1 guest