Changeset 17402 in josm for trunk/src/org
- Timestamp:
- 2020-12-12T11:31:51+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r16967 r17402 920 920 public void loadAllTiles(boolean force) { 921 921 TileSet ts = getVisibleTileSet(); 922 923 // if there is more than 18 tiles on screen in any direction, do not load all tiles!924 if (ts.tooLarge()) {925 Logging.warn("Not downloading all tiles because there is more than 18 tiles on an axis!");926 return;927 }928 922 ts.loadAllTiles(force); 929 923 invalidate(); … … 1291 1285 1292 1286 private void loadAllTiles(boolean force) { 1293 if (!getDisplaySettings().isAutoLoad() && !force) 1287 if (!getDisplaySettings().isAutoLoad() && !force) { 1294 1288 return; 1289 } 1290 if (tooLarge()) { 1291 // Too many tiles... refuse to download 1292 Logging.warn("Not downloading all tiles because there is more than 18 tiles on an axis!"); 1293 return; 1294 } 1295 1295 List<Tile> allTiles = allTilesCreate(); 1296 1296 allTiles.sort(getTileDistanceComparator()); … … 1305 1305 private void overloadTiles() { 1306 1306 int overload = 1; 1307 1307 1308 int minXo = Utils.clamp(minX-overload, tileSource.getTileXMin(zoom), tileSource.getTileXMax(zoom)); 1308 1309 int maxXo = Utils.clamp(maxX+overload, tileSource.getTileXMin(zoom), tileSource.getTileXMax(zoom)); 1309 1310 int minYo = Utils.clamp(minY-overload, tileSource.getTileYMin(zoom), tileSource.getTileYMax(zoom)); 1310 1311 int maxYo = Utils.clamp(maxY+overload, tileSource.getTileYMin(zoom), tileSource.getTileYMax(zoom)); 1311 for (int x = minXo; x < maxXo; ++x) { 1312 for (int y = minYo; y < maxYo; ++y) { 1313 loadTile(getOrCreateTile(x, y, zoom), false); 1314 } 1315 } 1312 1313 TileSet ts = new TileSet(new TileXY(minXo, minYo), new TileXY(maxXo, maxYo), zoom); 1314 ts.loadAllTiles(false); 1316 1315 } 1317 1316 … … 1550 1549 TileSet ts = dts.getTileSet(zoom); 1551 1550 1552 // Too many tiles... refuse to download 1553 if (!ts.tooLarge()) { 1554 // try to load tiles from desired zoom level, no matter what we will show (for example, tiles from previous zoom level 1555 // on zoom in) 1556 ts.loadAllTiles(false); 1557 } 1551 // try to load tiles from desired zoom level, no matter what we will show (for example, tiles from previous zoom level 1552 // on zoom in) 1553 ts.loadAllTiles(false); 1558 1554 1559 1555 if (displayZoomLevel != zoom) {
Note:
See TracChangeset
for help on using the changeset viewer.