Changeset 32761 in osm for applications/viewer/jmapviewer


Ignore:
Timestamp:
2016-08-03T14:32:53+02:00 (8 years ago)
Author:
glebius
Message:

Add possibility to specify a custom templated URL to be used with Scanex
projection algorithm.

File:
1 edited

Legend:

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

    r32760 r32761  
    4949    /** IRS by default */
    5050    private ScanexLayer layer = ScanexLayer.IRS;
     51    private TemplatedTMSTileSource TemplateSource = null;
    5152
    5253    /** cached latitude used in {@link #tileYToLat(double, int)} */
     
    6869                if (maxZoom == 0)
    6970                    this.maxZoom = DEFAULT_MAXZOOM;
    70                 break;
     71                return;
    7172            }
    7273        }
     74        /** If not "irs" or "spot" keyword, then a custom URL. */
     75        TemplatedTMSTileSource.checkUrl(info.getUrl());
     76        this.TemplateSource = new TemplatedTMSTileSource(info);
    7377    }
    7478
     
    7680    public String getExtension() {
    7781        return "jpeg";
     82    }
     83
     84   @Override
     85    public String getTileUrl(int zoom, int tilex, int tiley) {
     86        if (this.TemplateSource != null)
     87            return this.TemplateSource.getTileUrl(zoom, tilex, tiley);
     88        else
     89            return this.getBaseUrl() + getTilePath(zoom, tilex, tiley);
    7890    }
    7991
Note: See TracChangeset for help on using the changeset viewer.