- Timestamp:
- 2017-10-21T14:17:17+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
r12865 r13029 160 160 161 161 try { 162 tile.finishLoading(); // whatever happened set that loading has finished 163 // set tile metadata 164 if (this.attributes != null) { 165 for (Entry<String, String> e: this.attributes.getMetadata().entrySet()) { 166 tile.putValue(e.getKey(), e.getValue()); 162 tile.finishLoading(); // whatever happened set that loading has finished 163 // set tile metadata 164 if (this.attributes != null) { 165 for (Entry<String, String> e: this.attributes.getMetadata().entrySet()) { 166 tile.putValue(e.getKey(), e.getValue()); 167 } 168 } 169 170 switch(result) { 171 case SUCCESS: 172 handleNoTileAtZoom(); 173 if (attributes != null) { 174 int httpStatusCode = attributes.getResponseCode(); 175 if (httpStatusCode >= 400 && !isNoTileAtZoom()) { 176 if (attributes.getErrorMessage() == null) { 177 tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode)); 178 } else { 179 tile.setError(tr("Error downloading tiles: {0}", attributes.getErrorMessage())); 180 } 181 status = false; 167 182 } 168 183 } 169 170 switch(result) { 171 case SUCCESS: 172 handleNoTileAtZoom(); 173 if (attributes != null) { 174 int httpStatusCode = attributes.getResponseCode(); 175 if (httpStatusCode >= 400 && !isNoTileAtZoom()) { 176 if (attributes.getErrorMessage() == null) { 177 tile.setError(tr("HTTP error {0} when loading tiles", httpStatusCode)); 178 } else { 179 tile.setError(tr("Error downloading tiles: {0}", attributes.getErrorMessage())); 180 } 181 status = false; 182 } 183 } 184 status &= tryLoadTileImage(object); //try to keep returned image as background 185 break; 186 case FAILURE: 187 tile.setError("Problem loading tile"); 188 tryLoadTileImage(object); 189 break; 190 case CANCELED: 191 tile.loadingCanceled(); 192 // do nothing 193 } 184 status &= tryLoadTileImage(object); //try to keep returned image as background 185 break; 186 case FAILURE: 187 tile.setError("Problem loading tile"); 188 tryLoadTileImage(object); 189 break; 190 case CANCELED: 191 tile.loadingCanceled(); 192 // do nothing 193 } 194 194 195 195 // always check, if there is some listener interested in fact, that tile has finished loading … … 270 270 byte[] content = object.getContent(); 271 271 if (content.length > 0) { 272 tile.loadImage(new ByteArrayInputStream(content)); 272 try { 273 tile.loadImage(new ByteArrayInputStream(content)); 274 } catch (UnsatisfiedLinkError e) { 275 throw new IOException(e); 276 } 273 277 if (tile.getImage() == null) { 274 278 tile.setError(tr("Could not load image from tile server"));
Note:
See TracChangeset
for help on using the changeset viewer.