Changeset 13885 in josm for trunk/src


Ignore:
Timestamp:
2018-06-03T23:59:53+02:00 (15 months ago)
Author:
wiktorn
Message:

Add information about custom headers to Show tile info

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r13884 r13885  
    3939import java.util.Objects;
    4040import java.util.Set;
     41import java.util.TreeSet;
    4142import java.util.concurrent.ConcurrentSkipListSet;
    4243import java.util.concurrent.atomic.AtomicInteger;
     
    460461                content.add(Arrays.asList(tr("Tile name"), tile.getKey()));
    461462                content.add(Arrays.asList(tr("Tile URL"), url));
     463                if (tile.getTileSource() instanceof TemplatedTileSource) {
     464                    Map<String, String> headers = ((TemplatedTileSource) tile.getTileSource()).getHeaders();
     465                    for(String key: new TreeSet<>(headers.keySet())) {
     466                        // iterate over sorted keys
     467                        content.add(Arrays.asList(tr("Custom header: {0}", key), headers.get(key)));
     468                    }
     469                }
    462470                content.add(Arrays.asList(tr("Tile size"),
    463471                        getSizeString(tile.getTileSource().getTileSize())));
Note: See TracChangeset for help on using the changeset viewer.