Package org.openstreetmap.josm.gui.layer
Class WMTSLayer
-
- All Implemented Interfaces:
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: http://www.opengeospatial.org/standards/wmts
-
-
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 String
CACHE_REGION_NAME
private static String
PREFERENCE_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
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
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 TileSourceDisplaySettings
createDisplaySettings()
This method creates theTileSourceDisplaySettings
object.int
getBestZoom()
Returns best zoom level.static org.apache.commons.jcs3.access.CacheAccess<String,BufferedImageCacheEntry>
getCache()
Returns cache region for WMTS layer.protected String
getCacheName()
protected int
getMinZoomLvl()
Collection<String>
getNativeProjections()
Get projections this imagery layer supports natively.NativeScaleLayer.ScaleList
getNativeScales()
Get native scales of this layer.protected Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader>
getTileLoaderClass()
protected WMTSTileSource
getTileSource()
Creates and returns a newTileSource
instance depending onImageryLayer.info
specified in the constructor.void
projectionChanged(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, 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 String PREFERENCE_PREFIX
- See Also:
- Constant Field Values
-
CACHE_REGION_NAME
private static final 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:AbstractTileSourceLayer
This method creates theTileSourceDisplaySettings
object. Subclasses may implement it to e.g. change the prefix.- Overrides:
createDisplaySettings
in classAbstractTileSourceLayer<WMTSTileSource>
- Returns:
- The object.
-
getTileSource
protected WMTSTileSource getTileSource()
Description copied from class:AbstractTileSourceLayer
Creates and returns a newTileSource
instance depending onImageryLayer.info
specified in the constructor.- Specified by:
getTileSource
in classAbstractTileSourceLayer<WMTSTileSource>
- Returns:
- TileSource for specified ImageryInfo
-
getBestZoom
public int getBestZoom()
Description copied from class:AbstractTileSourceLayer
Returns best zoom level.- Overrides:
getBestZoom
in classAbstractTileSourceLayer<WMTSTileSource>
- Returns:
- best zoom level
-
getMinZoomLvl
protected int getMinZoomLvl()
- Overrides:
getMinZoomLvl
in classAbstractTileSourceLayer<WMTSTileSource>
-
getNativeProjections
public Collection<String> getNativeProjections()
Description copied from class:AbstractTileSourceLayer
Get 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:
getNativeProjections
in 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:
projectionChanged
in interfaceProjectionChangeListener
- Overrides:
projectionChanged
in classAbstractTileSourceLayer<WMTSTileSource>
-
getTileLoaderClass
protected Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader> getTileLoaderClass()
- Specified by:
getTileLoaderClass
in classAbstractCachedTileSourceLayer<WMTSTileSource>
-
getCacheName
protected String getCacheName()
- Specified by:
getCacheName
in classAbstractCachedTileSourceLayer<WMTSTileSource>
-
getCache
public static org.apache.commons.jcs3.access.CacheAccess<String,BufferedImageCacheEntry> getCache()
Returns cache region for WMTS layer.- Returns:
- cache region for WMTS layer
-
getNativeScales
public NativeScaleLayer.ScaleList getNativeScales()
Description copied from interface:NativeScaleLayer
Get native scales of this layer.- Specified by:
getNativeScales
in interfaceNativeScaleLayer
- Returns:
NativeScaleLayer.ScaleList
of native scales
-
-