Changeset 15456 in josm for trunk


Ignore:
Timestamp:
2019-10-13T22:10:29+02:00 (5 years ago)
Author:
wiktorn
Message:

Allow zoom in TMS layer up to 24.

See: #18064

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r15030 r15456  
    150150    /** maximum zoom level supported */
    151151    public static final int MAX_ZOOM = 30;
    152     /** minium zoom level supported */
     152    /** minimum zoom level supported */
    153153    public static final int MIN_ZOOM = 2;
    154154    private static final Font InfoFont = new Font("sansserif", Font.BOLD, 13);
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r12620 r15456  
    77
    88import org.apache.commons.jcs.access.CacheAccess;
     9import org.openstreetmap.gui.jmapviewer.JMapViewer;
    910import org.openstreetmap.gui.jmapviewer.OsmMercator;
    1011import org.openstreetmap.gui.jmapviewer.interfaces.TileLoader;
     
    1213import org.openstreetmap.gui.jmapviewer.tilesources.ScanexTileSource;
    1314import org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource;
    14 import org.openstreetmap.gui.jmapviewer.tilesources.TemplatedTMSTileSource;
    1515import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
    1616import org.openstreetmap.josm.data.imagery.CachedAttributionBingAerialTileSource;
    1717import org.openstreetmap.josm.data.imagery.ImageryInfo;
    1818import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
     19import org.openstreetmap.josm.data.imagery.JosmTemplatedTMSTileSource;
    1920import org.openstreetmap.josm.data.imagery.TMSCachedTileLoader;
    2021import org.openstreetmap.josm.data.preferences.BooleanProperty;
     
    4546    public static final BooleanProperty PROP_ADD_TO_SLIPPYMAP_CHOOSER = new BooleanProperty(PREFERENCE_PREFIX + ".add_to_slippymap_chooser",
    4647            true);
     48    /** override minimum/maximum zoom level with those supported by JMapViewer, as these might be used in slippymap chooser */
     49    public static final int MAX_ZOOM = JMapViewer.MAX_ZOOM;
     50    public static final int MIN_ZOOM = JMapViewer.MIN_ZOOM;
    4751
    4852    private static final ScaleList nativeScaleList = initNativeScaleList();
     
    112116    public static TMSTileSource getTileSourceStatic(ImageryInfo info, Runnable attributionLoadedTask) {
    113117        if (info.getImageryType() == ImageryType.TMS) {
    114             TemplatedTMSTileSource.checkUrl(info.getUrl());
    115             TMSTileSource t = new TemplatedTMSTileSource(info);
     118            JosmTemplatedTMSTileSource.checkUrl(info.getUrl());
     119            TMSTileSource t = new JosmTemplatedTMSTileSource(info);
    116120            info.setAttribution(t);
    117121            return t;
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java

    r10568 r15456  
    1616import org.openstreetmap.josm.gui.layer.imagery.TileSourceDisplaySettings;
    1717import org.openstreetmap.josm.tools.GBC;
     18import org.openstreetmap.josm.tools.Utils;
    1819
    1920/**
     
    4041        super(new GridBagLayout());
    4142        minZoomLvl = new JSpinner(new SpinnerNumberModel(
    42                 TMSLayer.PROP_MIN_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM, 1));
     43                Utils.clamp(TMSLayer.PROP_MIN_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM),
     44                TMSLayer.MIN_ZOOM,
     45                TMSLayer.MAX_ZOOM, 1));
    4346        maxZoomLvl = new JSpinner(new SpinnerNumberModel(
    44                 TMSLayer.PROP_MAX_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM, 1));
     47                Utils.clamp(TMSLayer.PROP_MAX_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM),
     48                TMSLayer.MIN_ZOOM,
     49                TMSLayer.MAX_ZOOM, 1));
    4550        maxConcurrentDownloads = new JSpinner(new SpinnerNumberModel(
    4651                TMSCachedTileLoader.THREAD_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1));
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java

    r15095 r15456  
    3636import org.openstreetmap.gui.jmapviewer.tilesources.BingAerialTileSource;
    3737import org.openstreetmap.gui.jmapviewer.tilesources.ScanexTileSource;
    38 import org.openstreetmap.gui.jmapviewer.tilesources.TemplatedTMSTileSource;
    3938import org.openstreetmap.josm.TestUtils;
    4039import org.openstreetmap.josm.actions.AddImageryLayerAction;
     
    4746import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
    4847import org.openstreetmap.josm.data.imagery.ImageryLayerInfo;
     48import org.openstreetmap.josm.data.imagery.JosmTemplatedTMSTileSource;
    4949import org.openstreetmap.josm.data.imagery.LayerDetails;
    5050import org.openstreetmap.josm.data.imagery.Shape;
     
    366366                return new ScanexTileSource(info);
    367367            case TMS:
    368                 return new TemplatedTMSTileSource(info);
     368                return new JosmTemplatedTMSTileSource(info);
    369369            case WMS_ENDPOINT:
    370370                info = convertWmsEndpointToWms(info); // fall-through
Note: See TracChangeset for help on using the changeset viewer.