Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 6 Dec 2011 18:37:53
Topic: New BlackBerry sample app
See more news »

Network error and restarting MapComponent

3 replies [Last post]
mwicat
User offline. Last seen 1 year 22 weeks ago. Offline
Joined: 07/05/2010

Hi,

I know I can capture network errors with setErrorListener. But then, how can I stop MapComponent from displaying "Network error!" and reinitialize itself? stopMapping; startMapping() sequence doesn't work - startMapping throws IllegalThreadStateException so I suppose startMapping doesn't recreate Thread objects and tries to restart dead threads. Do i have to recreate MapComponent and set properties from the beginning on every error? This behaviour makes it pretty unusable (for instance gprs can fail pretty often)

Marek Wiewiórski
Aportuj MX Software Developer
Internet: www.aportuj.pl

jaak
User offline. Last seen 1 day 10 hours ago. Offline
Joined: 06/19/2008

Right now you should recreate MapComponent, error situation closes threads (does automatic stopMapping) like you describe. This "Network error!" situation can come during initialization only, if GPRS fails later, then map shows "missing tile" images during blackout and does not do "stopMapping". If network is back, then also tile loading resumes automatically.

/JaakL

venkatesh92
User offline. Last seen 1 year 26 weeks ago. Offline
Joined: 07/22/2010

hi jaak,

I created Mapcomponent in one screen i need to navigate to other screen and come back to map Screen that time illegalthreadsafeexception showing..

How to retrieve this problem

any help please

jaak
User offline. Last seen 1 day 10 hours ago. Offline
Joined: 06/19/2008

You should use MapComponent as singelton. The simplest (but not most elegant) way would be to create mapComponent on Screen1 as public field. If map is needed to be accessed on another screen then you access it a as Screen1.mapComponent, instead of creating new MapComponent there.

/JaakL