Changeset 30222 in osm


Ignore:
Timestamp:
2014-01-23T21:48:22+01:00 (11 years ago)
Author:
glebius
Message:

Make ScanexTileSource be TMSTileSource, so user can override URL and
max zoom level. Useful for debugging or running through proxies. The
old URL scheme "scanex:(irs|spot)", that used hardcoded URL is
transparently supported.

File:
1 edited

Legend:

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

    r29757 r30222  
    55import org.openstreetmap.gui.jmapviewer.OsmMercator;
    66
    7 public class ScanexTileSource extends AbstractTMSTileSource {
     7public class ScanexTileSource extends TMSTileSource {
     8    private static final String DEFAULT_URL = "http://maps.kosmosnimki.ru";
     9    private static final int DEFAULT_MAXZOOM = 14;
    810    private static String API_KEY = "4018C5A9AECAD8868ED5DEB2E41D09F7";
    911
     
    3032    private ScanexLayer Layer = ScanexLayer.IRS;
    3133
    32     public ScanexTileSource(String url) {
    33         super("Scanex " + url, "http://maps.kosmosnimki.ru");
     34    public ScanexTileSource(String name, String url, int maxZoom) {
     35        super(name, url, maxZoom);
    3436
    3537        for (ScanexLayer layer : ScanexLayer.values()) {
    3638            if (url.equalsIgnoreCase(layer.getName())) {
    3739                this.Layer = layer;
     40                /*
     41                 * Override baseUrl and maxZoom in base class.
     42                 */
     43                this.baseUrl = DEFAULT_URL;
     44                if (maxZoom == 0)
     45                    this.maxZoom = DEFAULT_MAXZOOM;
    3846                break;
    3947            }
    4048        }
    41     }
    42 
    43     @Override
    44     public int getMaxZoom() {
    45         return 14;
    4649    }
    4750
Note: See TracChangeset for help on using the changeset viewer.