Ignore:
Timestamp:
2011-03-24T21:06:37+01:00 (14 years ago)
Author:
upliner
Message:

add support for OsGeo tiling scheme in TemplatedTMSTileSource

File:
1 edited

Legend:

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

    r25369 r25694  
    44public class TemplatedTMSTileSource extends AbstractOsmTileSource {
    55    private int maxZoom;
    6    
     6
    77    public TemplatedTMSTileSource(String name, String url, int maxZoom) {
    88        super(name, url);
     
    1010    }
    1111
     12    @Override
    1213    public String getTileUrl(int zoom, int tilex, int tiley) {
    1314        return this.baseUrl
    1415        .replaceAll("\\{zoom\\}", Integer.toString(zoom))
    1516        .replaceAll("\\{x\\}", Integer.toString(tilex))
    16         .replaceAll("\\{y\\}", Integer.toString(tiley));
    17        
     17        .replaceAll("\\{y\\}", Integer.toString(tiley))
     18        .replaceAll("\\{!y\\}", Integer.toString((int)Math.pow(2, zoom)-1-tiley));
     19
    1820    }
    1921
Note: See TracChangeset for help on using the changeset viewer.