Changeset 10545 in josm
- Timestamp:
- 2016-07-17T12:40:18+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r10469 r10545 387 387 } catch (IOException e) { 388 388 log.log(Level.FINE, "JCS - IOExecption during communication with server for: {0}", getUrlNoException()); 389 attributes.setError(e); 390 attributes.setResponseCode(499); // set dummy error code 391 boolean doCache = isResponseLoadable(null, 499, null) || cacheAsEmpty(); //generic 499 error code returned 392 if (doCache) { 393 cacheData = createCacheEntry(new byte[]{}); 394 cache.put(getCacheKey(), createCacheEntry(new byte[]{}), attributes); 395 } 396 return doCache; 389 if (isObjectLoadable()) { 390 return true; 391 } else { 392 attributes.setError(e); 393 attributes.setResponseCode(499); // set dummy error code 394 boolean doCache = isResponseLoadable(null, 499, null) || cacheAsEmpty(); //generic 499 error code returned 395 if (doCache) { 396 cacheData = createCacheEntry(new byte[]{}); 397 cache.put(getCacheKey(), createCacheEntry(new byte[]{}), attributes); 398 } 399 return doCache; 400 } 401 397 402 } catch (InterruptedException e) { 398 403 attributes.setError(e); -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r10534 r10545 703 703 int ret = (int) Math.ceil( 704 704 Math.pow(2d, ZOOM_OFFSET.get()) * visibileTiles // use offset to decide, how many tiles are visible 705 * 2);705 * 4); 706 706 Main.info("AbstractTileSourceLayer: estimated visible tiles: {0}, estimated cache size: {1}", visibileTiles, ret); 707 707 return ret; … … 1205 1205 1206 1206 1207 private final TileSet nullTileSet = new TileSet( (LatLon) null, (LatLon) null, 0);1207 private final TileSet nullTileSet = new TileSet(); 1208 1208 1209 1209 private final class MapWrappingTileSet extends TileSet { … … 1254 1254 TileXY t2 = tileSource.latLonToTileXY(botRight.toCoordinate(), zoom); 1255 1255 1256 x0 = t1.getXIndex();1257 y0 = t1.getYIndex();1258 x1 = t2.getXIndex();1259 y1 = t2.getYIndex();1256 x0 = (int) Math.floor(t1.getX()); 1257 y0 = (int) Math.floor(t1.getY()); 1258 x1 = (int) Math.ceil(t2.getX()); 1259 y1 = (int) Math.ceil(t2.getY()); 1260 1260 sanitize(); 1261 1262 } 1263 1264 private TileSet(Tile topLeft, Tile botRight, int zoom) { 1265 } 1266 1267 /** 1268 * null tile set 1269 */ 1270 private TileSet() { 1271 return; 1261 1272 } 1262 1273 … … 1390 1401 } 1391 1402 } 1403 1404 @Override 1405 public String toString() { 1406 return getClass().getName() + ": zoom: " + zoom + " X(" + x0 + ", " + x1 + ") Y(" + y0 + ", " + y1 + ") size: " + size(); 1407 } 1392 1408 } 1393 1409 … … 1558 1574 } 1559 1575 Tile t2 = tempCornerTile(missed); 1560 LatLon topLeft2 = getShiftedLatLon(tileSource.tileXYToLatLon(missed)); 1561 LatLon botRight2 = getShiftedLatLon(tileSource.tileXYToLatLon(t2)); 1562 TileSet ts2 = new TileSet(topLeft2, botRight2, newzoom); 1576 TileSet ts2 = new TileSet( 1577 getShiftedLatLon(tileSource.tileXYToLatLon(missed)), 1578 getShiftedLatLon(tileSource.tileXYToLatLon(t2)), 1579 newzoom); 1563 1580 // Instantiating large TileSets is expensive. If there 1564 1581 // are no loaded tiles, don't bother even trying.
Note:
See TracChangeset
for help on using the changeset viewer.