001// License: GPL. For details, see Readme.txt file.
002package org.openstreetmap.gui.jmapviewer.tilesources;
003
004public class TMSTileSource extends AbstractTMSTileSource {
005
006    protected int maxZoom;
007    protected int minZoom = 0;
008
009    public TMSTileSource(String name, String url, int maxZoom) {
010        super(name, url);
011        this.maxZoom = maxZoom;
012    }
013
014    public TMSTileSource(String name, String url, int minZoom, int maxZoom) {
015        super(name, url);
016        this.minZoom = minZoom;
017        this.maxZoom = maxZoom;
018    }
019
020    @Override
021    public int getMinZoom() {
022        return (minZoom == 0) ? super.getMinZoom() : minZoom;
023    }
024
025    @Override
026    public int getMaxZoom() {
027        return (maxZoom == 0) ? super.getMaxZoom() : maxZoom;
028    }
029
030    public TileUpdate getTileUpdate() {
031        return TileUpdate.IfNoneMatch;
032    }
033}