Index: trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java	(revision 8713)
+++ trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java	(revision 8714)
@@ -10,5 +10,7 @@
 
 import org.openstreetmap.gui.jmapviewer.tilesources.BingAerialTileSource;
+import org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.io.CacheCustomContent;
 import org.openstreetmap.josm.io.UTFInputStreamReader;
@@ -23,4 +25,6 @@
  */
 public class CachedAttributionBingAerialTileSource extends BingAerialTileSource {
+    private Runnable attributionDownloadedTask;
+
     /**
      * Creates tile source
@@ -30,4 +34,16 @@
         super(info);
     }
+
+    /**
+     * Creates tile source
+     * @param info ImageryInfo description of this tile source
+     * @param attributionDownloadedTask runnable to be executed once attribution is loaded
+     */
+
+    public CachedAttributionBingAerialTileSource(TileSourceInfo info, Runnable attributionDownloadedTask) {
+        super(info);
+        this.attributionDownloadedTask = attributionDownloadedTask;
+    }
+
 
     class BingAttributionData extends CacheCustomContent<IOException> {
@@ -59,5 +75,10 @@
                     try {
                         String xml = attributionLoader.updateIfRequiredString();
-                        return parseAttributionText(new InputSource(new StringReader((xml))));
+                        List<Attribution> ret = parseAttributionText(new InputSource(new StringReader((xml))));
+                        if (attributionDownloadedTask != null) {
+                            GuiHelper.runInEDT(attributionDownloadedTask);
+                            attributionDownloadedTask = null;
+                        }
+                        return ret;
                     } catch (IOException ex) {
                         Main.warn("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds.");
Index: trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 8713)
+++ trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 8714)
@@ -879,5 +879,5 @@
     }
 
-    private void loadAllTiles(boolean force) {
+    protected void loadAllTiles(boolean force) {
         TileSet ts = getVisibleTileSet();
 
@@ -890,5 +890,5 @@
     }
 
-    private void loadAllErrorTiles(boolean force) {
+    protected void loadAllErrorTiles(boolean force) {
         TileSet ts = getVisibleTileSet();
         ts.loadAllErrorTiles(force);
Index: trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 8713)
+++ trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 8714)
@@ -10,4 +10,5 @@
 import org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource;
 import org.openstreetmap.gui.jmapviewer.tilesources.TemplatedTMSTileSource;
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
 import org.openstreetmap.josm.data.imagery.CachedAttributionBingAerialTileSource;
@@ -67,5 +68,11 @@
     @Override
     protected AbstractTMSTileSource getTileSource(ImageryInfo info) throws IllegalArgumentException {
-        return getTileSourceStatic(info);
+        return getTileSourceStatic(info, new Runnable() {
+            @Override
+            public void run() {
+                Main.debug("Attribution loaded, running loadAllErrorTiles");
+                TMSLayer.this.loadAllErrorTiles(true);
+            }
+        });
     }
 
@@ -97,4 +104,21 @@
      */
     public static AbstractTMSTileSource getTileSourceStatic(ImageryInfo info) throws IllegalArgumentException {
+        return getTileSourceStatic(info, null);
+    }
+
+    /**
+     * Creates and returns a new TileSource instance depending on the {@link ImageryType}
+     * of the passed ImageryInfo object.
+     *
+     * If no appropriate TileSource is found, null is returned.
+     * Currently supported ImageryType are {@link ImageryType#TMS},
+     * {@link ImageryType#BING}, {@link ImageryType#SCANEX}.
+     *
+     * @param info imagery info
+     * @param attributionLoadedTask task to be run once attribution is loaded, might be null, if nothing special shall happen
+     * @return a new TileSource instance or null if no TileSource for the ImageryInfo/ImageryType could be found.
+     * @throws IllegalArgumentException if url from imagery info is null or invalid
+     */
+    public static AbstractTMSTileSource getTileSourceStatic(ImageryInfo info, Runnable attributionLoadedTask) throws IllegalArgumentException {
         if (info.getImageryType() == ImageryType.TMS) {
             TemplatedTMSTileSource.checkUrl(info.getUrl());
@@ -103,5 +127,5 @@
             return t;
         } else if (info.getImageryType() == ImageryType.BING)
-            return new CachedAttributionBingAerialTileSource(info);
+            return new CachedAttributionBingAerialTileSource(info, attributionLoadedTask);
         else if (info.getImageryType() == ImageryType.SCANEX) {
             return new ScanexTileSource(info);
