Ignore:
Timestamp:
2011-07-01T09:30:04+02:00 (14 years ago)
Author:
stoecker
Message:

improve TMS zoom handling

Location:
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources
Files:
2 edited

Legend:

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

    r25369 r26235  
    33
    44public class TMSTileSource extends AbstractOsmTileSource {
    5     private int maxZoom;
     5    protected int maxZoom;
     6    protected int minZoom = 0;
    67
    78    public TMSTileSource(String name, String url, int maxZoom) {
    89        super(name, url);
    910        this.maxZoom = maxZoom;
     11    }
     12
     13    public TMSTileSource(String name, String url, int minZoom, int maxZoom) {
     14        super(name, url);
     15        this.minZoom = minZoom;
     16        this.maxZoom = maxZoom;
     17    }
     18
     19    @Override
     20    public int getMinZoom() {
     21        return (minZoom == 0) ? super.getMinZoom() : minZoom;
    1022    }
    1123
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java

    r25694 r26235  
    22
    33
    4 public class TemplatedTMSTileSource extends AbstractOsmTileSource {
    5     private int maxZoom;
     4public class TemplatedTMSTileSource extends TMSTileSource {
     5    public TemplatedTMSTileSource(String name, String url, int maxZoom) {
     6        super(name, url, maxZoom);
     7    }
    68
    7     public TemplatedTMSTileSource(String name, String url, int maxZoom) {
    8         super(name, url);
    9         this.maxZoom = maxZoom;
     9    public TemplatedTMSTileSource(String name, String url, int minZoom, int maxZoom) {
     10        super(name, url, minZoom, maxZoom);
    1011    }
    1112
     
    1920
    2021    }
    21 
    22     @Override
    23     public int getMaxZoom() {
    24         return (maxZoom == 0) ? super.getMaxZoom() : maxZoom;
    25     }
    26 
    27     public TileUpdate getTileUpdate() {
    28         return TileUpdate.IfNoneMatch;
    29     }
    3022}
Note: See TracChangeset for help on using the changeset viewer.