From 73e881a82171f4fba8c107eaa729b8e9a8c5b4b0 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Sun, 27 Oct 2013 15:02:34 +0100 Subject: [PATCH] Fix online maps --- OsmAnd/src/net/osmand/plus/resources/ResourceManager.java | 4 ++-- OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 32f3904813..d53231534f 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -92,8 +92,8 @@ public class ResourceManager { // at least 3*9? protected int maxImgCacheSize = 28; - protected Map cacheOfImages = new LinkedHashMap(); - protected Map imagesOnFS = new LinkedHashMap() ; + protected Map cacheOfImages = new ConcurrentHashMap(); + protected Map imagesOnFS = new ConcurrentHashMap() ; protected File dirWithTiles ; diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index ca46ec0eb9..fcc1ab75ac 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -537,8 +537,12 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall @Override public void run() { baseHandler.removeMessages(BASE_REFRESH_MESSAGE); - refreshBaseMapInternal(currentViewport.copy(), drawSettings); - sendRefreshMapMsg(drawSettings, 0); + try { + refreshBaseMapInternal(currentViewport.copy(), drawSettings); + sendRefreshMapMsg(drawSettings, 0); + } catch(Exception e) { + log.error(e.getMessage(), e); + } } }); msg.what = BASE_REFRESH_MESSAGE;