Changeset 8714 in josm for trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
- Timestamp:
- 2015-09-01T22:57:30+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r8602 r8714 10 10 import org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource; 11 11 import org.openstreetmap.gui.jmapviewer.tilesources.TemplatedTMSTileSource; 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; 13 14 import org.openstreetmap.josm.data.imagery.CachedAttributionBingAerialTileSource; … … 67 68 @Override 68 69 protected AbstractTMSTileSource getTileSource(ImageryInfo info) throws IllegalArgumentException { 69 return getTileSourceStatic(info); 70 return getTileSourceStatic(info, new Runnable() { 71 @Override 72 public void run() { 73 Main.debug("Attribution loaded, running loadAllErrorTiles"); 74 TMSLayer.this.loadAllErrorTiles(true); 75 } 76 }); 70 77 } 71 78 … … 97 104 */ 98 105 public static AbstractTMSTileSource getTileSourceStatic(ImageryInfo info) throws IllegalArgumentException { 106 return getTileSourceStatic(info, null); 107 } 108 109 /** 110 * Creates and returns a new TileSource instance depending on the {@link ImageryType} 111 * of the passed ImageryInfo object. 112 * 113 * If no appropriate TileSource is found, null is returned. 114 * Currently supported ImageryType are {@link ImageryType#TMS}, 115 * {@link ImageryType#BING}, {@link ImageryType#SCANEX}. 116 * 117 * @param info imagery info 118 * @param attributionLoadedTask task to be run once attribution is loaded, might be null, if nothing special shall happen 119 * @return a new TileSource instance or null if no TileSource for the ImageryInfo/ImageryType could be found. 120 * @throws IllegalArgumentException if url from imagery info is null or invalid 121 */ 122 public static AbstractTMSTileSource getTileSourceStatic(ImageryInfo info, Runnable attributionLoadedTask) throws IllegalArgumentException { 99 123 if (info.getImageryType() == ImageryType.TMS) { 100 124 TemplatedTMSTileSource.checkUrl(info.getUrl()); … … 103 127 return t; 104 128 } else if (info.getImageryType() == ImageryType.BING) 105 return new CachedAttributionBingAerialTileSource(info); 129 return new CachedAttributionBingAerialTileSource(info, attributionLoadedTask); 106 130 else if (info.getImageryType() == ImageryType.SCANEX) { 107 131 return new ScanexTileSource(info);
Note:
See TracChangeset
for help on using the changeset viewer.
