public abstract class TileFactory extends Object
Modifier | Constructor and Description |
---|---|
protected |
TileFactory(TileFactoryInfo info)
Creates a new instance of TileFactory
|
Modifier and Type | Method and Description |
---|---|
void |
addTileListener(TileListener listener)
Adds a tile listener
|
abstract void |
dispose()
Disposes this TileFactory
|
protected void |
fireTileLoadedEvent(Tile tile)
Notifies all tile listeners
|
Point2D |
geoToPixel(GeoPosition c,
int zoomLevel)
Convert a GeoPosition to a pixel position in the world bitmap a the specified zoom level.
|
TileFactoryInfo |
getInfo()
Get the TileFactoryInfo describing this TileFactory
|
Dimension |
getMapSize(int zoom)
Returns a Dimension containing the width and height of the map, in tiles at the current zoom level.
|
abstract Tile |
getTile(int x,
int y,
int zoom)
Return the Tile at a given TilePoint and zoom level
|
int |
getTileSize(int zoom)
Gets the size of an edge of a tile in pixels at the current zoom level.
|
GeoPosition |
pixelToGeo(Point2D pixelCoordinate,
int zoom)
Convert a pixel in the world bitmap at the specified zoom level into a GeoPosition
|
void |
removeTileListener(TileListener listener)
Removes a tile listener
|
protected abstract void |
startLoading(Tile tile)
Override this method to load the tile using, for example, an
ExecutorService . |
protected TileFactory(TileFactoryInfo info)
info
- a TileFactoryInfo to configure this TileFactorypublic int getTileSize(int zoom)
zoom
- the current zoom levelpublic Dimension getMapSize(int zoom)
zoom
- the current zoom levelpublic abstract Tile getTile(int x, int y, int zoom)
x
- the x valuey
- the y valuezoom
- the current zoom levelpublic GeoPosition pixelToGeo(Point2D pixelCoordinate, int zoom)
pixelCoordinate
- a Point2D representing a pixel in the world bitmapzoom
- the zoom level of the world bitmappublic Point2D geoToPixel(GeoPosition c, int zoomLevel)
c
- a GeoPositionzoomLevel
- the zoom level to extract the pixel coordinate forpublic TileFactoryInfo getInfo()
public void addTileListener(TileListener listener)
listener
- the listenerpublic void removeTileListener(TileListener listener)
listener
- the listenerpublic abstract void dispose()
protected void fireTileLoadedEvent(Tile tile)
tile
- the tileprotected abstract void startLoading(Tile tile)
ExecutorService
.tile
- The tile to load.Copyright © 2013. All Rights Reserved.