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
| Attachment | Size |
|---|---|
| DefaultDownloadStreamOpener.java | 5.54 KB |
Thank you, it helped me to resolve that problem :)
MobiTrip
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