Class AbstractTileSourceLayer<T extends org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource>
- Type Parameters:
T- Tile Source class used for this layer
- All Implemented Interfaces:
ImageObserver,org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener,ProjectionChangeListener,ImageryFilterSettings.FilterChangeListener,TileSourceDisplaySettings.DisplaySettingsChangeListener,MapViewPaintable,NavigatableComponent.ZoomChangeListener,Destroyable
- Direct Known Subclasses:
AbstractCachedTileSourceLayer
- Since:
- 3715, 8526 (copied from TMSLayer)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate classprivate static final classprivate static final classprivate static final classprivate static classClass to store a menu action and the class it belongs to.private classAn entry for a bookmark in the offset menu.classTask responsible for precaching imagery along the gpx trackprivate static final classprotected classprivate static final classData container to hold information about aTileSetclass.classTile source layer popup menu.private final classNested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer
ImageryLayer.OffsetAction, ImageryLayer.OffsetMenuEntryNested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.Layer
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerActionNested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
AbstractMapViewPaintable.CompatibilityModeLayerPainterNested classes/interfaces inherited from interface org.openstreetmap.josm.gui.layer.MapViewPaintable
MapViewPaintable.LayerPainter, MapViewPaintable.MapViewEvent, MapViewPaintable.PaintableInvalidationEvent, MapViewPaintable.PaintableInvalidationListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MouseAdapterprivate final ImageryAdjustActionprivate final org.openstreetmap.gui.jmapviewer.AttributionSupportprotected TileCoordinateConverterprivate intZoomlevel at which tiles is currently downloaded.private final TileSourceDisplaySettingsprivate static final Stringprivate static final Fontprivate final TimerA timer that is used to delay invalidation events if required.private intZoom level the tiles were actually displayed at (auto-zoom fallback) for attributionprivate static final intstatic final intmaximum zoom level supportedprivate static final List<AbstractTileSourceLayer.MenuAddition>additional layer menu actionsstatic final intminimum zoom level supportedprivate final longprivate final AbstractTileSourceLayer<T>.TileSetprivate static final BooleanPropertyprivate static final Stringstatic final IntegerPropertymaximum zoom level to show to userstatic final IntegerPropertyminimum zoom level to show to userprivate static final NamedColorPropertyColor of the border drawn around each tile if enabled, seeTileSourceDisplaySettings.isShowTileBorders()private static final Strokeprotected org.openstreetmap.gui.jmapviewer.interfaces.TileCacheprotected org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderprotected Tstatic final IntegerPropertyOffset between calculated zoom level and zoom level used to download and show tiles.Fields inherited from class org.openstreetmap.josm.gui.layer.ImageryLayer
icon, info, PROP_SHARPEN_LEVELFields inherited from class org.openstreetmap.josm.gui.layer.Layer
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROPFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates Tile Source based Imagery Layer based on Imagery Info -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanactionSupportLayers(List<Layer> layers) Default implementation ofLayer.LayerAction.supportLayers(List).This method is called whenever this layer is added to a map view.private static intcalculateRealTiles(int visibleTiles, int maxXtiles, int maxYtiles) Take into account ZOOM_OFFSET to calculate real number of tiles and multiply by 7, to cover all tiles, that might be accessed when looking for tiles outside current zoom level.static intcheckMaxZoomLvl(int maxZoomLvl, org.openstreetmap.gui.jmapviewer.interfaces.TileSource ts) Checks zoom level against settingsstatic intcheckMinZoomLvl(int minZoomLvl, org.openstreetmap.gui.jmapviewer.interfaces.TileSource ts) Checks zoom level against settingsvoidRemove all cached error tilesvoidClears the tile cache.Creates a new "Save" dialog for this layer and makes it visible.protected TileSourceDisplaySettingsThis method creates theTileSourceDisplaySettingsobject.protected MapViewPaintable.LayerPainterCreates a new LayerPainter.org.openstreetmap.gui.jmapviewer.TilecreateTile(T source, int x, int y, int zoom) Create a new tile.booleanZoom out from map.voiddestroy()Called, when the layer is removed from the mapview and is going to be destroyed.voidCalled whenever the display settings have changed.private voiddrawImageInside(Graphics2D g, BufferedImage toDrawImg, TileAnchor anchorImage, TileAnchor anchorScreen, Shape clip) Draw a tile image on screen.private voiddrawInViewArea(Graphics2D g, MapView mv, ProjectionBounds pb) protected intvoidInvoked when the filter is changed.protected Actionprivate static TileAnchorgetAnchor(org.openstreetmap.gui.jmapviewer.Tile tile, BufferedImage image) intReturns best zoom level.Action[]Returns the common menu entries.Gets theTileSourceDisplaySettingsinstance associated with this tile source.getDownloadAreaToCacheTask(ProgressMonitor progressMonitor, List<LatLon> points, double bufferX, double bufferY) Calculates tiles, that needs to be downloaded to cache, gets a current tile loader and creates a task to download all of the tiles.getHeaders(T tileSource) Gets the layer information to display to the user.Action[]Returns the contextual menu entries in layer list dialog.private BufferedImagegetLoadedTileImage(org.openstreetmap.gui.jmapviewer.Tile tile) Returns the image for the given tile image is loaded.protected intstatic intgetMaxZoomLvl(org.openstreetmap.gui.jmapviewer.interfaces.TileSource ts) Returns maximum max zoom level, that will be shown on layer.Prepare list of additional layer context menu entries.Action[]Returns list of actions.protected intstatic intgetMinZoomLvl(org.openstreetmap.gui.jmapviewer.interfaces.TileSource ts) Returns minimum zoom level, that will be shown on layer.abstract Collection<String>Get projections this imagery layer supports natively.protected List<ImageryLayer.OffsetMenuEntry>private org.openstreetmap.gui.jmapviewer.TilegetOrCreateTile(int x, int y, int zoom) private org.openstreetmap.gui.jmapviewer.TilegetOrCreateTile(TilePosition tilePosition) doublegetScaleFactor(int zoom) Returns average number of screen pixels per tile pixel for current mapviewprivate org.openstreetmap.gui.jmapviewer.interfaces.ICoordinateprivate LatLonprivate org.openstreetmap.gui.jmapviewer.TilegetTile(int x, int y, int zoom) Returns tile at given position.private org.openstreetmap.gui.jmapviewer.TilegetTile(TilePosition tilePosition) private org.openstreetmap.gui.jmapviewer.TilegetTileForPixelpos(int px, int py) Returns tile for a pixel position.protected abstract TileLoaderFactoryprotected AbstractTileSourceLayer<T>.TileSetgetTileSet(ProjectionBounds bounds, int zoom) Create a TileSet by EastNorth bbox taking a layer shift in accountprotected abstract TCreates and returns a newTileSourceinstance depending onImageryLayer.infospecified in the constructor.(package private) BufferedImagegetTileStatusImage(org.openstreetmap.gui.jmapviewer.Tile tile) Returns the image which shows the state of a tile that failed to load.Returns a small tooltip hint about some statistics for this layer.private AbstractTileSourceLayer<T>.TileSetintGet the current zoom level of the layervoidCreates popup menu items and binds to mouse actionsprivate booleanimageLoaded(Image i) booleanimageUpdate(Image img, int infoflags, int x, int y, int width, int height) booleanZoom in, go closer to map.private voidprotected voidinitTileSource(T tileSource) private voidInvalidate the layer at a time in the future so that the user still sees the interface responsive.booleanReplies the savable state of this layer (i.e., if it can be saved through a "File → Save" dialog).voidloadAllErrorTiles(boolean force) Load all visible tiles in error.voidloadAllTiles(boolean force) Load all visible tiles.private booleanloadTile(org.openstreetmap.gui.jmapviewer.Tile tile, boolean force) private voidmyDrawString(Graphics g, String text, int x, int y) voidpaint(Graphics2D g, MapView mv, Bounds bounds) Paint the dataset using the engine set.voidpaintAttribution(Graphics2D g, MapView mv) Paints the imagery attribution as a viewport-fixed overlay.private List<org.openstreetmap.gui.jmapviewer.Tile>private List<org.openstreetmap.gui.jmapviewer.Tile>paintTileImages(Graphics2D g, AbstractTileSourceLayer<T>.TileSet ts, int zoom, org.openstreetmap.gui.jmapviewer.Tile border) private voidpaintTileStatus(org.openstreetmap.gui.jmapviewer.Tile tile, Graphics2D g) private voidpaintTileText(org.openstreetmap.gui.jmapviewer.Tile tile, Graphics2D g) voidprojectionChanged(Projection oldValue, Projection newValue) static voidregisterMenuAddition(Action addition) Register an additional layer context menu entry.static voidregisterMenuAddition(Action addition, Class<? extends AbstractTileSourceLayer<?>> clazz) Register an additional layer context menu entry for a imagery layer class.private static voidsendOsmTileRequest(org.openstreetmap.gui.jmapviewer.Tile tile, String request) static voidsetMaxZoomLvl(int maxZoomLvl) Sets maximum zoom level, that layer will attempt showstatic voidsetMinZoomLvl(int minZoomLvl) Sets minimum zoom level, that layer will attempt showbooleansetZoomLevel(int zoom) Sets the zoom level of the layerprivate booleansetZoomLevel(int zoom, boolean invalidate) voidtileLoadingFinished(org.openstreetmap.gui.jmapviewer.Tile tile, boolean success) private List<org.openstreetmap.gui.jmapviewer.Tile>tryLoadFromDifferentZoom(Graphics2D g, int displayZoomLevel, List<org.openstreetmap.gui.jmapviewer.Tile> missedTiles, int zoomOffset) voidVisits the content bounds of this layer.voidThis fires every time the user changes the zoom, but also (due to ZoomChangeListener) - on all changes to visible map (panning/zooming)private voidzoomChanged(boolean invalidate) booleanCheck if zooming out is allowedbooleanDetermines if it is allowed to zoom in.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, toStringMethods 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, toggleVisibleMethods inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
addInvalidationListener, invalidate, removeInvalidationListener
-
Field Details
-
PREFERENCE_PREFIX
- See Also:
-
MAX_TILES_SPANNED
- See Also:
-
MAX_ZOOM
maximum zoom level supported- See Also:
-
MIN_ZOOM
minimum zoom level supported- See Also:
-
InfoFont
-
PROP_MIN_ZOOM_LVL
minimum zoom level to show to user -
PROP_MAX_ZOOM_LVL
maximum zoom level to show to user -
currentZoomLevel
Zoomlevel at which tiles is currently downloaded. Initial zoom lvl is set to bestZoom -
lastDisplayZoomLevel
Zoom level the tiles were actually displayed at (auto-zoom fallback) for attribution -
attribution
-
ZOOM_OFFSET
Offset between calculated zoom level and zoom level used to download and show tiles. Negative values will result in lower resolution of imagery useful in "retina" displays, positive values will result in higher resolution -
POPUP_MENU_ENABLED
-
TILE_BORDER_COLOR
Color of the border drawn around each tile if enabled, seeTileSourceDisplaySettings.isShowTileBorders() -
TILE_BORDER_STROKE
-
ERROR_STRING
-
tileCache
-
tileSource
-
tileLoader
-
invalidateLaterTimer
A timer that is used to delay invalidation events if required. -
failedTiles
-
adapter
-
displaySettings
-
adjustAction
-
coordinateConverter
-
minimumTileExpire
-
nullTileSet
private final AbstractTileSourceLayer<T extends org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource>.TileSet nullTileSet
-
-
Constructor Details
-
AbstractTileSourceLayer
Creates Tile Source based Imagery Layer based on Imagery Info- Parameters:
info- imagery info
-
-
Method Details
-
createDisplaySettings
This method creates theTileSourceDisplaySettingsobject. Subclasses may implement it to e.g. change the prefix.- Returns:
- The object.
- Since:
- 10568
-
getDisplaySettings
Gets theTileSourceDisplaySettingsinstance associated with this tile source.- Returns:
- The tile source display settings
- Since:
- 10568
-
filterChanged
Description copied from interface:ImageryFilterSettings.FilterChangeListenerInvoked when the filter is changed.- Specified by:
filterChangedin interfaceImageryFilterSettings.FilterChangeListener
-
getTileLoaderFactory
-
getNativeProjections
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.
- Returns:
- projections this imagery layer supports natively; null if layer is projection agnostic.
-
getTileSource
Creates and returns a newTileSourceinstance depending onImageryLayer.infospecified in the constructor.- Returns:
- TileSource for specified ImageryInfo
- Throws:
IllegalArgumentException- when Imagery is not supported by layer
-
getHeaders
-
initTileSource
-
tileLoadingFinished
- Specified by:
tileLoadingFinishedin interfaceorg.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener
-
clearTileCache
Clears the tile cache. -
getInfoComponent
Description copied from class:LayerGets the layer information to display to the user. This is used if the user requests information about this layer. It should display a description of the layer content.- Overrides:
getInfoComponentin classImageryLayer- Returns:
- Either a String or a
Componentdescribing the layer.
-
getAdjustAction
- Specified by:
getAdjustActionin classImageryLayer
-
getScaleFactor
Returns average number of screen pixels per tile pixel for current mapview- Parameters:
zoom- zoom level- Returns:
- average number of screen pixels per tile pixel
-
getBestZoom
Returns best zoom level.- Returns:
- best zoom level
-
actionSupportLayers
Default implementation ofLayer.LayerAction.supportLayers(List).- Parameters:
layers- layers- Returns:
trueis layers contains only aTMSLayer
-
sendOsmTileRequest
-
hookUpMapView
Creates popup menu items and binds to mouse actions- Overrides:
hookUpMapViewin classLayer
-
attachToMapView
Description copied from class:AbstractMapViewPaintableThis method is called whenever this layer is added to a map view.You need to return a painter here. The
MapViewPaintable.LayerPainter.detachFromMapView(org.openstreetmap.josm.gui.layer.MapViewPaintable.MapViewEvent)method is called when the layer is removed from that map view. You are free to reuse painters.You should always call the super method. See
AbstractMapViewPaintable.createMapViewPainter(org.openstreetmap.josm.gui.layer.MapViewPaintable.MapViewEvent)if you want to influence painter creation.This replaces
Layer.hookUpMapView()in the long run.- Overrides:
attachToMapViewin classAbstractMapViewPaintable- Parameters:
event- the event.- Returns:
- A layer painter.
-
initializeIfRequired
-
createMapViewPainter
Description copied from class:AbstractMapViewPaintableCreates a new LayerPainter.- Overrides:
createMapViewPainterin classAbstractMapViewPaintable- Parameters:
event- The event that triggered the creation.- Returns:
- The painter.
-
estimateTileCacheSize
-
calculateRealTiles
Take into account ZOOM_OFFSET to calculate real number of tiles and multiply by 7, to cover all tiles, that might be accessed when looking for tiles outside current zoom level.Currently we use otherZooms = {1, 2, -1, -2, -3, -4, -5}
The value should be sum(2^x for x in (-5 to 2)) - 1 -1 to exclude current zoom level
Add +2 to maxYtiles / maxXtiles to add space in cache for extra tiles in current zoom level that are download by overloadTiles(). This is not added in computation of visibleTiles as this unnecessarily grow the cache size
Check call to tryLoadFromDifferentZoom
- Parameters:
visibleTiles- number of currently visible tilesmaxXtiles- maximum number of tiles along the horizontal (X) axismaxYtiles- maximum number of tiles along the vertical (Y) axis- Returns:
- estimated total number of tiles to load across zoom levels and borders
- See Also:
-
displaySettingsChanged
Description copied from interface:TileSourceDisplaySettings.DisplaySettingsChangeListenerCalled whenever the display settings have changed.- Specified by:
displaySettingsChangedin interfaceTileSourceDisplaySettings.DisplaySettingsChangeListener- Parameters:
e- The change event.
-
checkMaxZoomLvl
public static int checkMaxZoomLvl(int maxZoomLvl, org.openstreetmap.gui.jmapviewer.interfaces.TileSource ts) Checks zoom level against settings- Parameters:
maxZoomLvl- zoom level to checkts- tile source to crosscheck with- Returns:
- maximum zoom level, not higher than supported by tilesource nor set by the user
-
checkMinZoomLvl
public static int checkMinZoomLvl(int minZoomLvl, org.openstreetmap.gui.jmapviewer.interfaces.TileSource ts) Checks zoom level against settings- Parameters:
minZoomLvl- zoom level to checkts- tile source to crosscheck with- Returns:
- minimum zoom level, not higher than supported by tilesource nor set by the user
-
getMaxZoomLvl
Returns maximum max zoom level, that will be shown on layer.- Parameters:
ts- TileSource for which we want to know maximum zoom level- Returns:
- maximum max zoom level, that will be shown on layer
-
getMinZoomLvl
Returns minimum zoom level, that will be shown on layer.- Parameters:
ts- TileSource for which we want to know minimum zoom level- Returns:
- minimum zoom level, that will be shown on layer
-
setMaxZoomLvl
Sets maximum zoom level, that layer will attempt show- Parameters:
maxZoomLvl- maximum zoom level
-
setMinZoomLvl
Sets minimum zoom level, that layer will attempt show- Parameters:
minZoomLvl- minimum zoom level
-
zoomChanged
This fires every time the user changes the zoom, but also (due to ZoomChangeListener) - on all changes to visible map (panning/zooming)- Specified by:
zoomChangedin interfaceNavigatableComponent.ZoomChangeListener
-
zoomChanged
-
getMaxZoomLvl
-
getMinZoomLvl
-
zoomIncreaseAllowed
Determines if it is allowed to zoom in.- Returns:
- if it is allowed to zoom in
-
increaseZoomLevel
Zoom in, go closer to map.- Returns:
- true, if zoom increasing was successful, false otherwise
-
getZoomLevel
Get the current zoom level of the layer- Returns:
- the current zoom level
- Since:
- 12603
-
setZoomLevel
Sets the zoom level of the layer- Parameters:
zoom- zoom level- Returns:
- true, when zoom has changed to desired value, false if it was outside supported zoom levels
-
setZoomLevel
-
zoomDecreaseAllowed
Check if zooming out is allowed- Returns:
- true, if zooming out is allowed (currentZoomLevel > minZoomLevel)
-
decreaseZoomLevel
Zoom out from map.- Returns:
- true, if zoom increasing was successful, false otherwise
-
getOrCreateTile
-
getOrCreateTile
-
getTile
-
getTile
Returns tile at given position. This can and will return null for tiles that are not already in the cache.- Parameters:
x- tile number on the x axis of the tile to be retrievedy- tile number on the y axis of the tile to be retrievedzoom- zoom level of the tile to be retrieved- Returns:
- tile at given position
-
loadTile
-
getVisibleTileSet
-
loadAllTiles
Load all visible tiles.- Parameters:
force-trueto force loading if auto-load is disabled- Since:
- 11950
-
loadAllErrorTiles
Load all visible tiles in error.- Parameters:
force-trueto force loading if auto-load is disabled- Since:
- 11950
-
clearErrorTiles
Remove all cached error tiles- Since:
- 19192
-
imageUpdate
- Specified by:
imageUpdatein interfaceImageObserver
-
invalidateLater
Invalidate the layer at a time in the future so that the user still sees the interface responsive. -
imageLoaded
-
getLoadedTileImage
Returns the image for the given tile image is loaded. Otherwise returns null.- Parameters:
tile- the Tile for which the image should be returned- Returns:
- the image of the tile or null.
-
drawImageInside
private void drawImageInside(Graphics2D g, BufferedImage toDrawImg, TileAnchor anchorImage, TileAnchor anchorScreen, Shape clip) Draw a tile image on screen.- Parameters:
g- the Graphics2DtoDrawImg- tile imageanchorImage- tile anchor in image coordinatesanchorScreen- tile anchor in screen coordinatesclip- clipping region in screen coordinates (can be null)
-
paintTileImages
private List<org.openstreetmap.gui.jmapviewer.Tile> paintTileImages(Graphics2D g, AbstractTileSourceLayer<T>.TileSet ts) -
paintTileImages
private List<org.openstreetmap.gui.jmapviewer.Tile> paintTileImages(Graphics2D g, AbstractTileSourceLayer<T>.TileSet ts, int zoom, org.openstreetmap.gui.jmapviewer.Tile border) -
getAnchor
private static TileAnchor getAnchor(org.openstreetmap.gui.jmapviewer.Tile tile, BufferedImage image) -
myDrawString
-
getTileStatusImage
Returns the image which shows the state of a tile that failed to load.Tiles which never failed get no image, so that the normal loading of tiles shows the imagery of other zoom levels or layers, as before. Once a tile has failed, it shows the error image while it has its error, and the hourglass while it is loaded again, until it is loaded successfully (see #25133).
- Parameters:
tile- the tile- Returns:
Tile.ERROR_IMAGE,Tile.LOADING_IMAGE, ornullfor no image
-
paintTileStatus
-
paintTileText
-
getShiftedLatLon
-
getShiftedCoord
-
getTileSet
Create a TileSet by EastNorth bbox taking a layer shift in account- Parameters:
bounds- the EastNorth boundszoom- zoom level- Returns:
- the tile set
-
paint
Description copied from interface:MapViewPaintablePaint the dataset using the engine set.- Specified by:
paintin interfaceMapViewPaintable- Parameters:
g- Graphicsmv- The object that can translate GeoPoints to screen coordinates.bounds- Bounding box
-
paintAttribution
Paints the imagery attribution as a viewport-fixed overlay.- Parameters:
g- the graphics context to paint onmv- the map view to paint for- Since:
- 19701
-
drawInViewArea
-
tryLoadFromDifferentZoom
private List<org.openstreetmap.gui.jmapviewer.Tile> tryLoadFromDifferentZoom(Graphics2D g, int displayZoomLevel, List<org.openstreetmap.gui.jmapviewer.Tile> missedTiles, int zoomOffset) -
getTileForPixelpos
Returns tile for a pixel position.This isn't very efficient, but it is only used when the user right-clicks on the map.
- Parameters:
px- pixel X coordinatepy- pixel Y coordinate- Returns:
- Tile at pixel position
-
registerMenuAddition
Register an additional layer context menu entry.- Parameters:
addition- additional menu action- Since:
- 11197
-
registerMenuAddition
public static void registerMenuAddition(Action addition, Class<? extends AbstractTileSourceLayer<?>> clazz) Register an additional layer context menu entry for a imagery layer class. The menu entry is valid for the specified class and subclasses thereof only.Example:
TMSLayer.registerMenuAddition(new TMSSpecificAction(), TMSLayer.class);
- Parameters:
addition- additional menu actionclazz- class the menu action is registered for- Since:
- 11197
-
getMenuAdditions
Prepare list of additional layer context menu entries. The list is empty if there are no additional menu entries.- Returns:
- list of additional layer context menu entries
-
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- Specified by:
getMenuEntriesin classLayer- Returns:
- menu actions for this layer
-
getLayerListEntries
Returns the contextual menu entries in layer list dialog.- Returns:
- the contextual menu entries in layer list dialog
-
getCommonEntries
Returns the common menu entries.- Returns:
- the common menu entries
-
getToolTipText
Description copied from class:LayerReturns a small tooltip hint about some statistics for this layer.- Specified by:
getToolTipTextin classLayer- Returns:
- A small tooltip hint about some statistics for this layer.
-
visitBoundingBox
Description copied from class:LayerVisits the content bounds of this layer. The behavior of this method depends on the layer, but each implementation should attempt to cover the relevant content of the layer in this method.- Specified by:
visitBoundingBoxin classLayer- Parameters:
v- The visitor that gets notified about the contents of this layer.
-
getDownloadAreaToCacheTask
public AbstractTileSourceLayer<T>.PrecacheTask getDownloadAreaToCacheTask(ProgressMonitor progressMonitor, List<LatLon> points, double bufferX, double bufferY) Calculates tiles, that needs to be downloaded to cache, gets a current tile loader and creates a task to download all of the tiles. Buffer contains at least one tile.To prevent accidental clear of the queue, new download executor is created with separate queue
- Parameters:
progressMonitor- progress monitor for download taskpoints- lat/lon coordinates to downloadbufferX- how many units in current Coordinate Reference System to cover in X axis in both sidesbufferY- how many units in current Coordinate Reference System to cover in Y axis in both sides- Returns:
- precache task representing download task
-
isSavable
Description copied from class:LayerReplies the savable state of this layer (i.e., if it can be saved through a "File → Save" dialog). -
createAndOpenSaveFileChooser
Description copied from class:LayerCreates a new "Save" dialog for this layer and makes it visible.When the user has chosen a file, checks the file extension, and confirms overwriting if needed.
- Overrides:
createAndOpenSaveFileChooserin classLayer- Returns:
- The output
File - See Also:
-
createTile
Create a new tile. Added to allow use of customTileobjects.- Parameters:
source- Tile sourcex- X coordinatey- Y coordinatezoom- Zoom level- Returns:
- The new
Tile - Since:
- 17862
-
destroy
Description copied from class:LayerCalled, when the layer is removed from the mapview and is going to be destroyed.This is because the Layer constructor cannot add itself safely as a listener to the layerlist dialog, because there may be no such dialog yet (loaded via command line parameter).
- Specified by:
destroyin interfaceDestroyable- Overrides:
destroyin classLayer
-
projectionChanged
- Specified by:
projectionChangedin interfaceProjectionChangeListener- Overrides:
projectionChangedin classLayer
-
getOffsetMenuEntries
- Specified by:
getOffsetMenuEntriesin classImageryLayer
-