public abstract class MapProvider extends Object
Modifier | Constructor and Description |
---|---|
protected |
MapProvider(Projection p,
Dimension tileSize)
Creates a new MapProvider
|
Modifier and Type | Method and Description |
---|---|
abstract String |
attribution()
The provider attribution.
|
abstract BoundingBox |
bboxFor(Coord position,
int zoomLevel)
Returns the bounding box of a position ina given zoom level
|
int |
maxZoomFor(Tile tile)
Returns the maximum zoom of a specific Tile.
|
abstract int |
maxZoomLevel()
Maximal zoom level.
|
int |
minZoomLevel()
Minimal zoom level user is able to see.
|
Projection |
projection()
Gets the Provider projection
|
abstract Coord |
scale(int zoomLevel)
Scale is the distance in map units between each pixel in tile at given zoom level.
|
abstract Tile |
tileFor(BoundingBox bbox)
Gets a tile for the given bounding box
|
Dimension |
tileSize()
Gets the tile size
|
void |
tileSize(Dimension size)
Request map to provide tiles of specific sizes.
|
Coord |
translate(Coord position,
int zoomLevel,
int pixelsX,
int pixelsY)
Translates position by [pixelsX, pixelsY] at zoomLevel acordingly to maps scale.
|
protected MapProvider(Projection p, Dimension tileSize)
p
- the projection systemtileSize
- the tile sizepublic void tileSize(Dimension size)
size
- requested tile sizepublic abstract BoundingBox bboxFor(Coord position, int zoomLevel)
position
- on the mapzoomLevel
- the zoom levelpublic abstract Tile tileFor(BoundingBox bbox)
bbox
- a bounding boxpublic abstract int maxZoomLevel()
public int minZoomLevel()
public abstract Coord scale(int zoomLevel)
public Coord translate(Coord position, int zoomLevel, int pixelsX, int pixelsY)
position
- in map projectionzoomLevel
- pixelsX
- pixelsY
- public Projection projection()
public Dimension tileSize()
public abstract String attribution()
public int maxZoomFor(Tile tile)
tile
- tile to check the max zoom