Package org.jxmapviewer.viewer.empty
Class EmptyTileFactory
java.lang.Object
org.jxmapviewer.viewer.TileFactory
org.jxmapviewer.viewer.empty.EmptyTileFactory
public class EmptyTileFactory extends TileFactory
A null implementation of TileFactory. Draws empty areas.
-
Constructor Summary
Constructors Constructor Description EmptyTileFactory()Creates a new instance of EmptyTileFactoryEmptyTileFactory(TileFactoryInfo info)Creates a new instance of EmptyTileFactory using the specified info. -
Method Summary
Modifier and Type Method Description voiddispose()Disposes this TileFactoryTilegetTile(int x, int y, int zoom)Gets an instance of an empty tile for the given tile position and zoom on the world map.protected voidstartLoading(Tile tile)Override this method to load the tile using, for example, anExecutorService.Methods inherited from class org.jxmapviewer.viewer.TileFactory
addTileListener, fireTileLoadedEvent, geoToPixel, getInfo, getMapSize, getTileSize, pixelToGeo, removeTileListener, setLocalCache
-
Constructor Details
-
EmptyTileFactory
public EmptyTileFactory()Creates a new instance of EmptyTileFactory -
EmptyTileFactory
Creates a new instance of EmptyTileFactory using the specified info.- Parameters:
info- the tile factory info
-
-
Method Details
-
getTile
Gets an instance of an empty tile for the given tile position and zoom on the world map.- Specified by:
getTilein classTileFactory- Parameters:
x- The tile's x position on the world map.y- The tile's y position on the world map.zoom- The current zoom level.- Returns:
- the tile that is located at the given tilePoint for this zoom level. For example, if getMapSize() returns 10x20 for this zoom, and the tilePoint is (3,5), then the appropriate tile will be located and returned. This method must not return null. However, it can return dummy tiles that contain no data if it wants. This is appropriate, for example, for tiles which are outside of the bounds of the map and if the factory doesn't implement wrapping.
-
dispose
public void dispose()Description copied from class:TileFactoryDisposes this TileFactory- Specified by:
disposein classTileFactory
-
startLoading
Override this method to load the tile using, for example, anExecutorService.- Specified by:
startLoadingin classTileFactory- Parameters:
tile- The tile to load.
-