fix: unlock tiles properly onResume

This commit is contained in:
Hannes Janetzek
2012-11-07 23:13:57 +01:00
parent 7dd171dc24
commit dd64d6da26
7 changed files with 61 additions and 84 deletions

View File

@@ -99,6 +99,8 @@ public class MapView extends RelativeLayout {
private String mRenderTheme;
private Map<String, String> mMapOptions;
private boolean mClearTiles;
/**
* @param context
* the enclosing MapActivity instance.
@@ -310,15 +312,16 @@ public class MapView extends RelativeLayout {
mOverlayManager.onUpdate(mMapPosition, changed);
}
mTileManager.updateMap(false);
mTileManager.updateMap(mClearTiles);
mClearTiles = false;
}
public void clearAndRedrawMap() {
if (mPausing || this.getWidth() == 0 || this.getHeight() == 0)
return;
if (AndroidUtils.currentThreadIsUiThread())
mTileManager.updateMap(true);
//if (AndroidUtils.currentThreadIsUiThread())
mTileManager.updateMap(true);
}
/**
@@ -415,28 +418,25 @@ public class MapView extends RelativeLayout {
if (debugDatabase)
return;
TileGenerator tileGenerator;
Log.i(TAG, "setMapDatabase " + mapDatabaseType.name());
if (mMapDatabaseType == mapDatabaseType)
return;
mMapDatabaseType = mapDatabaseType;
mapWorkersPause(true);
for (MapWorker mapWorker : mMapWorkers) {
tileGenerator = mapWorker.getMapGenerator();
TileGenerator tileGenerator = mapWorker.getMapGenerator();
tileGenerator.setMapDatabase(MapDatabaseFactory
.createMapDatabase(mapDatabaseType));
}
mJobQueue.clear();
mClearTiles = true;
setMapOptions(null);
mapWorkersProceed();
}