Ignore:
Timestamp:
2012-08-15T22:52:04+02:00 (12 years ago)
Author:
jttt
Message:

better message when bing attribution is not loaded yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java

    r27519 r28553  
    22
    33//License: GPL.
     4
     5import static org.openstreetmap.josm.tools.I18n.tr;
    46
    57import java.awt.Image;
     
    3638
    3739public class BingAerialTileSource extends AbstractTMSTileSource {
     40
    3841    private static String API_KEY = "Arzdiw4nlOJzRwOz__qailc8NiR31Tt51dN2D7cm57NrnceZnCpgOkmJhNpGoppU";
    3942    private static volatile Future<List<Attribution>> attributions; // volatile is required for getAttribution(), see below.
     
    6164    public String getTileUrl(int zoom, int tilex, int tiley) throws IOException {
    6265        // make sure that attribution is loaded. otherwise subdomains is null.
    63         getAttribution();
     66        if (getAttribution() == null)
     67            throw new IOException(tr("Attribution is not loaded yet"));
    6468
    6569        int t = (zoom + tilex + tiley) % subdomains.length;
     
    240244        try {
    241245            final List<Attribution> data = getAttribution();
    242             if (data == null) {
     246            if (data == null)
    243247                return "Error loading Bing attribution data";
    244             }
    245248            StringBuilder a = new StringBuilder();
    246249            for (Attribution attr : data) {
Note: See TracChangeset for help on using the changeset viewer.