- Timestamp:
- 2021-02-21T16:10:35+01:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r17505 r17509 188 188 * Simple implementation. All errors should be cached as empty. Though some JDK (JDK8 on Windows for example) 189 189 * doesn't return 4xx error codes, instead they do throw an FileNotFoundException or IOException 190 * @param responseCode191 * @param headerFields190 * @param headerFields headers sent by server 191 * @param responseCode http status code 192 192 * 193 193 * @return true if we should put empty object into cache, regardless of what remote resource has returned -
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
r17505 r17509 136 136 } 137 137 if (isNotImage(headers, statusCode)) { 138 String message = detectErrorMessage( 138 String message = detectErrorMessage(new String(content, StandardCharsets.UTF_8)); 139 139 if (message != null && !message.isEmpty()) { 140 140 tile.setError(message); … … 148 148 if (statusCode == 200 && headers.containsKey("Content-Type") && !headers.get("Content-Type").isEmpty()) { 149 149 String contentType = headers.get("Content-Type").stream().findAny().get(); 150 if (contentType != null && !contentType.startsWith("image")) {150 if (contentType != null && !contentType.startsWith("image")) { 151 151 Logging.warn("Image not returned for tile: " + url + " content type was: " + contentType); 152 152 // not an image - do not store response in cache, so next time it will be queried again from the server -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r17507 r17509 664 664 Math.pow(2d, ZOOM_OFFSET.get()) * visibileTiles // use offset to decide, how many tiles are visible 665 665 * 8); 666 Logging.info("AbstractTileSourceLayer: estimated tiles proccessed on current zoom level: {0}, estimated cache size: {1}", visibileTiles, ret); 666 Logging.info("AbstractTileSourceLayer: estimated tiles proccessed on current zoom level: {0}, estimated cache size: {1}", 667 visibileTiles, ret); 667 668 return ret; 668 669 } … … 1598 1599 int[] otherZooms = {1, 2, -1, -2, -3, -4, -5}; 1599 1600 1600 for (int otherZoom: otherZooms) {1601 for (int otherZoom: otherZooms) { 1601 1602 missedTiles = tryLoadFromDifferentZoom(g, displayZoomLevel, missedTiles, otherZoom); 1602 1603 if (missedTiles.isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.