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, 3 Apr 2012 23:31:42
Topic: MapXT SDK evaluation
See more news »

Stop map network download

3 replies [Last post]
mobitrip
User offline. Last seen 11 weeks 4 days ago. Offline
Joined: 08/04/2011

Hi,

I use OpenStreetMap.MAPNIK for online map in my application. I have observed issue with map processing if there is problem with network connection. Downloading process waits for result and you are not able to move map at all. For instance I would like to scroll map to previously already downloaded and cached area.
Is there any way to stop map download or to control timeout result? Is there any way to get access to the HTTP Client?

Thanks,
MobiTrip

AttachmentSize
DefaultDownloadStreamOpener.java5.54 KB
jaak
User offline. Last seen 15 hours 38 min ago. Offline
Joined: 06/19/2008

The downloader can be set and overridden by basicMapComponent.setUrlOpener() method. I attached here default url opener class, you can build something similar. The existing class has also constructor with timeout option. For example 2 second timeout would be:

mapComponent.setDownloadStreamOpener(new DefaultDownloadStreamOpener("",2000));

Unstable network connections are quite tricky case - simple timeout often does not solve it fully as networking code could be in some specific state where it is unable to detect timeouts.

/JaakL

mobitrip
User offline. Last seen 11 weeks 4 days ago. Offline
Joined: 08/04/2011

Thank you, it helped me to resolve that problem :)

MobiTrip