Class MVTLayer
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
-
- org.openstreetmap.josm.gui.layer.Layer
-
- org.openstreetmap.josm.gui.layer.ImageryLayer
-
- org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer<T>
-
- org.openstreetmap.josm.gui.layer.AbstractCachedTileSourceLayer<MapboxVectorTileSource>
-
- org.openstreetmap.josm.gui.layer.imagery.MVTLayer
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener,MVTTile.TileListener,ProjectionChangeListener,ImageryFilterSettings.FilterChangeListener,TileSourceDisplaySettings.DisplaySettingsChangeListener,MapViewPaintable,NavigatableComponent.ZoomChangeListener,Destroyable
public class MVTLayer extends AbstractCachedTileSourceLayer<MapboxVectorTileSource> implements MVTTile.TileListener
A layer for Mapbox Vector Tiles- Since:
- 17862
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classMVTLayer.ConvertLayerActionprivate static classMVTLayer.EnableLayerAction-
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
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCACHE_REGION_NAMEprivate VectorDataSetdataSetprivate static javax.swing.Action[]EMPTY_ACTIONSprivate java.util.Map<java.lang.String,java.lang.Boolean>layerNames-
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 MVTLayer(ImageryInfo info)Creates an instance of an MVT layer
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openstreetmap.gui.jmapviewer.TilecreateTile(MapboxVectorTileSource source, int x, int y, int zoom)Create a new tile.voidfinishedLoading(MVTTile tile)Called when the MVTTile is finished loadingstatic org.apache.commons.jcs3.access.CacheAccess<java.lang.String,BufferedImageCacheEntry>getCache()Returns cache region for MVT layer.protected java.lang.StringgetCacheName()VectorDataSetgetData()Get the data set for this layerjavax.swing.Action[]getMenuEntries()Returns list of actions.java.util.Collection<java.lang.String>getNativeProjections()Get projections this imagery layer supports natively.protected java.lang.Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader>getTileLoaderClass()protected MapboxVectorTileSourcegetTileSource()Creates and returns a newTileSourceinstance depending onImageryLayer.infospecified in the constructor.voidpaint(java.awt.Graphics2D g, MapView mv, Bounds box)Paint the dataset using the engine set.-
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, createDisplaySettings, createMapViewPainter, decreaseZoomLevel, destroy, displaySettingsChanged, estimateTileCacheSize, filterChanged, getAdjustAction, getBestZoom, getCommonEntries, getDisplaySettings, getDownloadAreaToCacheTask, getHeaders, getInfoComponent, getLayerListEntries, getMaxZoomLvl, getMaxZoomLvl, getMinZoomLvl, getMinZoomLvl, getOffsetMenuEntries, getScaleFactor, getTileSet, getToolTipText, getZoomLevel, hookUpMapView, imageUpdate, increaseZoomLevel, initTileSource, isSavable, loadAllErrorTiles, loadAllTiles, projectionChanged, 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
-
CACHE_REGION_NAME
private static final java.lang.String CACHE_REGION_NAME
- See Also:
- Constant Field Values
-
EMPTY_ACTIONS
private static final javax.swing.Action[] EMPTY_ACTIONS
-
layerNames
private final java.util.Map<java.lang.String,java.lang.Boolean> layerNames
-
dataSet
private final VectorDataSet dataSet
-
-
Constructor Detail
-
MVTLayer
public MVTLayer(ImageryInfo info)
Creates an instance of an MVT layer- Parameters:
info- ImageryInfo describing the layer
-
-
Method Detail
-
getTileLoaderClass
protected java.lang.Class<? extends org.openstreetmap.gui.jmapviewer.interfaces.TileLoader> getTileLoaderClass()
- Specified by:
getTileLoaderClassin classAbstractCachedTileSourceLayer<MapboxVectorTileSource>
-
getCacheName
protected java.lang.String getCacheName()
- Specified by:
getCacheNamein classAbstractCachedTileSourceLayer<MapboxVectorTileSource>
-
getCache
public static org.apache.commons.jcs3.access.CacheAccess<java.lang.String,BufferedImageCacheEntry> getCache()
Returns cache region for MVT layer.- Returns:
- cache region for MVT layer
- Since:
- 18186
-
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<MapboxVectorTileSource>- Returns:
- projections this imagery layer supports natively; null if layer is projection agnostic.
-
paint
public void paint(java.awt.Graphics2D g, MapView mv, Bounds box)
Description copied from interface:MapViewPaintablePaint the dataset using the engine set.- Specified by:
paintin interfaceMapViewPaintable- Overrides:
paintin classAbstractTileSourceLayer<MapboxVectorTileSource>- Parameters:
g- Graphicsmv- The object that can translate GeoPoints to screen coordinates.box- Bounding box
-
getTileSource
protected MapboxVectorTileSource getTileSource()
Description copied from class:AbstractTileSourceLayerCreates and returns a newTileSourceinstance depending onImageryLayer.infospecified in the constructor.- Specified by:
getTileSourcein classAbstractTileSourceLayer<MapboxVectorTileSource>- Returns:
- TileSource for specified ImageryInfo
-
createTile
public org.openstreetmap.gui.jmapviewer.Tile createTile(MapboxVectorTileSource source, int x, int y, int zoom)
Description copied from class:AbstractTileSourceLayerCreate a new tile. Added to allow use of customTileobjects.- Overrides:
createTilein classAbstractTileSourceLayer<MapboxVectorTileSource>- Parameters:
source- Tile sourcex- X coordinatey- Y coordinatezoom- Zoom level- Returns:
- The new
Tile
-
getMenuEntries
public javax.swing.Action[] getMenuEntries()
Description copied from class:LayerReturns list of actions. Action can implement LayerAction interface when it needs to be represented by other menu component than JMenuItem or when it supports multiple layers. Actions that support multiple layers should also have correct equals implementation.Use
Layer.SeparatorLayerAction.INSTANCEinstead of new JSeparator- Overrides:
getMenuEntriesin classAbstractTileSourceLayer<MapboxVectorTileSource>- Returns:
- menu actions for this layer
-
getData
public VectorDataSet getData()
Get the data set for this layer
-
finishedLoading
public void finishedLoading(MVTTile tile)
Description copied from interface:MVTTile.TileListenerCalled when the MVTTile is finished loading- Specified by:
finishedLoadingin interfaceMVTTile.TileListener- Parameters:
tile- The tile that finished loading
-
-