Multiple MapView Issues

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

Multiple MapView Issues

Postby debellpepper » Sat May 15, 2010 5:36 am

I have two MapActivities which each have their own MapView. When I start one MapActivity, my tiles download fine and all is well. Then when I navigate away from the MapActivity (paused) to view a list of data and start the second MapActivity, everything works fine (tiles download, etc). But when I navigate away from the second MapActivity to resume the first one, my tiles longer download. Also the lat/lon position of the first MapActivity is moved to where the second MapActivity was (and only the cached tiles from the second MapActivity are viewable), even though I had a seperate MapView.

Should I be able to have two different MapActivities with their own MapViews? I came across documentation that suggest I should be able to have two MapViews (burried in info about using a single apikey for Android apps, and that one "could" use the single key for multiple MapViews), but I haven't found any documentation that seems to address multiple MapActivities/Views etc.

Is my approach wrong? Is it not okay to have multiple MapActivites in an Android app... is there onResume initialization one should always do on resuming MapActivites (currently I'm doing none)?

Any help is appreciated... thanks.
debellpepper
Once Poster
Once Poster
 
Posts: 1
Joined: Sat May 15, 2010 5:17 am

Top

Re: Multiple MapView Issues

Postby JKumar » Fri Jun 04, 2010 9:22 am

HI,

Your approach is perfect .

You just need to make sure of independent data for both the map activity and refresh the map using on Resume whenever you go to any Map Activity with their independent data.

Its not a big issue, needs a bit care while handling to map views as it has to be refreshed else it will take the updated map view data last accessed in any map view.
Hope the suggestion helps you
Keep posting .It makes us better to understand Android
User avatar
JKumar
Experienced Developer
Experienced Developer
 
Posts: 52
Joined: Thu May 13, 2010 8:17 am
Location: INDIA

Re: Multiple MapView Issues

Postby mathias.lin » Fri Jul 02, 2010 5:28 pm

What do you mean with "refresh" ? Do you mean calling an mapView.invalidate(); or how? Thanks.

I read in the bug tracker of Android that another solution would be to use different processes for each map activity.
See the latest two comments in http://code.google.com/p/android/issues/detail?id=3756
User avatar
mathias.lin
Experienced Developer
Experienced Developer
 
Posts: 60
Joined: Tue Aug 11, 2009 4:21 am
Location: Guangzhou, China

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 2 guests