Skip to content
This repository was archived by the owner on Apr 27, 2024. It is now read-only.

Commit 0c54d5d

Browse files
committed
TileManager:
- set zoomMin/Max for current TileSource - add zoom-level switch threshold - add TileManager.getTile() - remove releaseTiles() - extract JobCompletedEvent from anonymous class
1 parent 2c5db19 commit 0c54d5d

File tree

4 files changed

+150
-96
lines changed

4 files changed

+150
-96
lines changed

vtm/src/org/oscim/layers/tile/JobQueue.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*
2-
* Copyright 2010, 2011, 2012 mapsforge.org
32
* Copyright 2012, 2013 Hannes Janetzek
43
*
54
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
@@ -20,11 +19,16 @@
2019
import static org.oscim.layers.tile.MapTile.State.LOADING;
2120
import static org.oscim.layers.tile.MapTile.State.NONE;
2221

22+
import org.slf4j.Logger;
23+
import org.slf4j.LoggerFactory;
24+
2325
/**
2426
* A JobQueue keeps the list of pending jobs for a MapView and prioritizes them.
2527
*/
2628
public class JobQueue {
2729

30+
static final Logger log = LoggerFactory.getLogger(JobQueue.class);
31+
2832
private int mCurrentJob = 0;
2933
private MapTile[] mJobs;
3034

@@ -51,7 +55,12 @@ public synchronized void clear() {
5155
MapTile[] tiles = mJobs;
5256

5357
for (int i = mCurrentJob, n = mJobs.length; i < n; i++) {
54-
tiles[i].state = NONE;
58+
59+
if (tiles[i].state == LOADING)
60+
tiles[i].state = NONE;
61+
else
62+
log.debug("wrong tile in queue {} {}", tiles[i], tiles[i].state);
63+
5564
tiles[i] = null;
5665
}
5766
mCurrentJob = 0;

0 commit comments

Comments
 (0)