Changeset 24660 in osm


Ignore:
Timestamp:
2010-12-08T22:16:23+01:00 (14 years ago)
Author:
upliner
Message:

imagery: make attribution data loading asynchronous

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/tms/BingAerialTileSource.java

    r24652 r24660  
    66import java.net.URL;
    77import java.util.ArrayList;
    8 import java.util.Collections;
    98import java.util.List;
    109
     
    2625    public BingAerialTileSource() {
    2726        super("Bing Aerial Maps", "http://ecn.t2.tiles.virtualearth.net/tiles/");
     27
     28        if (attributions == null) {
     29            Thread t = new Thread(new Runnable() {
     30                @Override
     31                public void run() {
     32                    attributions = loadAttributionText();
     33                    System.err.println("Added " + attributions.size() + " attributions.");
     34                }
     35            });
     36            t.setDaemon(true);
     37            t.run();
     38        }
    2839    }
    2940
     
    105116            e.printStackTrace();
    106117        }
    107         return Collections.emptyList();
     118        return null;
    108119    }
    109120
     
    155166    public String getAttributionText(int zoom, LatLon topLeft, LatLon botRight) {
    156167        if (attributions == null) {
    157             attributions = loadAttributionText();
    158             System.err.println("Added " + attributions.size() + " attributions.");
     168            // TODO: don't show Bing tiles until attribution data is loaded
     169            return "";
    159170        }
    160171        Bounds windowBounds = new Bounds(topLeft, botRight);
Note: See TracChangeset for help on using the changeset viewer.