Package org.openstreetmap.josm.gui.layer
Class WMTSLayer
- java.lang.Object
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener,ProjectionChangeListener,ImageryFilterSettings.FilterChangeListener,TileSourceDisplaySettings.DisplaySettingsChangeListener,MapViewPaintable,NativeScaleLayer,NavigatableComponent.ZoomChangeListener,Destroyable
public class WMTSLayer extends AbstractCachedTileSourceLayer<WMTSTileSource> implements NativeScaleLayer
WMTS layer based on AbstractTileSourceLayer. Overrides few methods to align WMTS to Tile based computations but most magic is done within WMTSTileSource class.Full specification of the protocol available at: OpenGIS Web Map Tile Service Implementation Standard
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer
AbstractTileSourceLayer.PrecacheTask, AbstractTileSourceLayer.TileSet, AbstractTileSourceLayer.TileSourceLayerPopup
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer
ImageryLayer.OffsetAction, ImageryLayer.OffsetMenuEntry
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.Layer
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
AbstractMapViewPaintable.CompatibilityModeLayerPainter
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.layer.MapViewPaintable
MapViewPaintable.LayerPainter, MapViewPaintable.MapViewEvent, MapViewPaintable.PaintableInvalidationEvent, MapViewPaintable.PaintableInvalidationListener
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.layer.NativeScaleLayer
NativeScaleLayer.Scale, NativeScaleLayer.ScaleList
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCACHE_REGION_NAMEprivate static java.lang.StringPREFERENCE_PREFIX-
Fields inherited from class org.openstreetmap.josm.gui.layer.AbstractCachedTileSourceLayer
MAX_DISK_CACHE_SIZE
-
Fields inherited from class org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer
coordinateConverter, MAX_ZOOM, MIN_ZOOM, PROP_MAX_ZOOM_LVL, PROP_MIN_ZOOM_LVL, tileCache, tileLoader, tileSource, ZOOM_OFFSET
-
Fields inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer
icon, info, PROP_SHARPEN_LEVEL
-
Fields inherited from class org.openstreetmap.josm.gui.layer.Layer
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
-
-
Constructor Summary
Constructors Constructor Description WMTSLayer(ImageryInfo info)Creates WMTS layer from ImageryInfo
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TileSourceDisplaySettingscreateDisplaySettings()This method creates theTileSourceDisplaySettingsobject.intgetBestZoom()Returns best zoom level.static org.apache.commons.jcs3.access.CacheAccess<java.lang.String,BufferedImageCacheEntry>getCache()Returns cache region for WMTS layer.protected java.lang.StringgetCacheName()protected intgetMinZoomLvl()java.util.Collection<java.lang.String>getNativeProjections()Get projections this imagery layer supports natively.NativeScaleLayer.ScaleListgetNativeScales()Get native scales of this layer.protected java.lang.Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader>getTileLoaderClass()protected WMTSTileSourcegetTileSource()Creates and returns a newTileSourceinstance depending onImageryLayer.infospecified in the constructor.voidprojectionChanged(Projection oldValue, Projection newValue)-
Methods inherited from class org.openstreetmap.josm.gui.layer.AbstractCachedTileSourceLayer
getCache, getDiskCacheSize, getTileLoaderFactory, getTileLoaderFactory, setTileLoaderFactory
-
Methods inherited from class org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer
actionSupportLayers, attachToMapView, checkMaxZoomLvl, checkMinZoomLvl, clearErrorTiles, clearTileCache, createAndOpenSaveFileChooser, createMapViewPainter, createTile, decreaseZoomLevel, destroy, displaySettingsChanged, estimateTileCacheSize, filterChanged, getAdjustAction, getCommonEntries, getDisplaySettings, getDownloadAreaToCacheTask, getHeaders, getInfoComponent, getLayerListEntries, getMaxZoomLvl, getMaxZoomLvl, getMenuEntries, getMinZoomLvl, getOffsetMenuEntries, getScaleFactor, getTileSet, getToolTipText, getZoomLevel, hookUpMapView, imageUpdate, increaseZoomLevel, initTileSource, isSavable, loadAllErrorTiles, loadAllTiles, paint, registerMenuAddition, registerMenuAddition, setMaxZoomLvl, setMinZoomLvl, setZoomLevel, tileLoadingFinished, visitBoundingBox, zoomChanged, zoomDecreaseAllowed, zoomIncreaseAllowed
-
Methods inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer
addImageProcessor, applyImageProcessors, create, createImageProcessor, createTextField, getChangesetSourceTag, getFilterSettings, getIcon, getImageProcessors, getInfo, getOffsetMenuItem, getOffsetMenuItem, getPPD, isMergable, mergeFrom, removeImageProcessor, toString
-
Methods inherited from class org.openstreetmap.josm.gui.layer.Layer
addPropertyChangeListener, checkSaveConditions, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getDefaultLayerPosition, getLabel, getName, getOpacity, getViewProjectionBounds, hasColor, isBackgroundLayer, isInfoResizable, isProjectionSupported, isRenamed, isVisible, nameSupportedProjections, onPostLoadFromFile, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setColor, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible
-
Methods inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
addInvalidationListener, invalidate, removeInvalidationListener
-
-
-
-
Field Detail
-
PREFERENCE_PREFIX
private static final java.lang.String PREFERENCE_PREFIX
- See Also:
- Constant Field Values
-
CACHE_REGION_NAME
private static final java.lang.String CACHE_REGION_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WMTSLayer
public WMTSLayer(ImageryInfo info)
Creates WMTS layer from ImageryInfo- Parameters:
info- Imagery Info describing the layer
-
-
Method Detail
-
createDisplaySettings
protected TileSourceDisplaySettings createDisplaySettings()
Description copied from class:AbstractTileSourceLayerThis method creates theTileSourceDisplaySettingsobject. Subclasses may implement it to e.g. change the prefix.- Overrides:
createDisplaySettingsin classAbstractTileSourceLayer<WMTSTileSource>- Returns:
- The object.
-
getTileSource
protected WMTSTileSource getTileSource()
Description copied from class:AbstractTileSourceLayerCreates and returns a newTileSourceinstance depending onImageryLayer.infospecified in the constructor.- Specified by:
getTileSourcein classAbstractTileSourceLayer<WMTSTileSource>- Returns:
- TileSource for specified ImageryInfo
-
getBestZoom
public int getBestZoom()
Description copied from class:AbstractTileSourceLayerReturns best zoom level.- Overrides:
getBestZoomin classAbstractTileSourceLayer<WMTSTileSource>- Returns:
- best zoom level
-
getMinZoomLvl
protected int getMinZoomLvl()
- Overrides:
getMinZoomLvlin classAbstractTileSourceLayer<WMTSTileSource>
-
getNativeProjections
public java.util.Collection<java.lang.String> getNativeProjections()
Description copied from class:AbstractTileSourceLayerGet projections this imagery layer supports natively. For example projection of tiles that are downloaded from a server. Layer may support even more projections (by reprojecting the tiles), but with a certain loss in image quality and performance.- Specified by:
getNativeProjectionsin classAbstractTileSourceLayer<WMTSTileSource>- Returns:
- projections this imagery layer supports natively; null if layer is projection agnostic.
-
projectionChanged
public void projectionChanged(Projection oldValue, Projection newValue)
- Specified by:
projectionChangedin interfaceProjectionChangeListener- Overrides:
projectionChangedin classAbstractTileSourceLayer<WMTSTileSource>
-
getTileLoaderClass
protected java.lang.Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader> getTileLoaderClass()
- Specified by:
getTileLoaderClassin classAbstractCachedTileSourceLayer<WMTSTileSource>
-
getCacheName
protected java.lang.String getCacheName()
- Specified by:
getCacheNamein classAbstractCachedTileSourceLayer<WMTSTileSource>
-
getCache
public static org.apache.commons.jcs3.access.CacheAccess<java.lang.String,BufferedImageCacheEntry> getCache()
Returns cache region for WMTS layer.- Returns:
- cache region for WMTS layer
-
getNativeScales
public NativeScaleLayer.ScaleList getNativeScales()
Description copied from interface:NativeScaleLayerGet native scales of this layer.- Specified by:
getNativeScalesin interfaceNativeScaleLayer- Returns:
NativeScaleLayer.ScaleListof native scales
-
-