public abstract class MapProvider

  1. Object
  2. MapProvider

Known subtypesTiledProvider

This is a generic map provider.

Constructors

protected MapProvider(Projection p, Dimension tileSize)Creates a new MapProvider

Methods

public void tileSize(Dimension size)Request map to provide tiles of specific sizes.
public abstract BoundingBox bboxFor(Coord position, int zoomLevel)Returns the bounding box of a position ina given zoom level
public abstract Tile tileFor(BoundingBox bbox)Gets a tile for the given bounding box
public abstract int maxZoomLevel()Maximal zoom level.
public int minZoomLevel()Minimal zoom level user is able to see.
public abstract Coord scale(int zoomLevel)Scale is the distance in map units between each pixel in tile at given zoom level.
public Coord translate(Coord position, int zoomLevel, int pixelsX, int pixelsY)Translates position by [pixelsX, pixelsY] at zoomLevel acordingly to maps scale.
public Projection projection()Gets the Provider projection
public Dimension tileSize()Gets the tile size
public abstract String attribution()The provider attribution.
public int maxZoomFor(Tile tile)Returns the maximum zoom of a specific Tile.

Inherited methods

Constructor details

MapProvider

protected MapProvider(Projection p, Dimension tileSize)
Creates a new MapProvider

Parameters

p Projection
the projection system
tileSize Dimension
the tile size

Method details

tileSize

public void tileSize(Dimension size)
Request map to provide tiles of specific sizes. May not be supported by map provider. By default it does nothing;

Parameters

size Dimension
requested tile size

bboxFor

public abstract BoundingBox bboxFor(Coord position, int zoomLevel)
Returns the bounding box of a position ina given zoom level

Parameters

position Coord
on the map
zoomLevel int
the zoom level

Returns

a bounding box

tileFor

public abstract Tile tileFor(BoundingBox bbox)
Gets a tile for the given bounding box

Parameters

bbox BoundingBox
a bounding box

Returns

a Tile for the given bounding box

maxZoomLevel

public abstract int maxZoomLevel()
Maximal zoom level. Zoom levels are counted from zero to maxZoomLevel(). 0 is farest view, where the scale is greatest.

minZoomLevel

public int minZoomLevel()
Minimal zoom level user is able to see.

scale

public abstract Coord scale(int zoomLevel)
Scale is the distance in map units between each pixel in tile at given zoom level.

Returns

Scale at given zoom level.

translate

public Coord translate(Coord position, int zoomLevel, int pixelsX, int pixelsY)
Translates position by [pixelsX, pixelsY] at zoomLevel acordingly to maps scale.

Parameters

position Coord
in map projection
zoomLevel int
Not documented.
pixelsX int
Not documented.
pixelsY int
Not documented.

Returns

translated position.

projection

public Projection projection()
Gets the Provider projection

Returns

the Provider projection

tileSize

public Dimension tileSize()
Gets the tile size

Returns

the tile size

attribution

public abstract String attribution()
The provider attribution.

Returns

a String of the provider attribution

maxZoomFor

public int maxZoomFor(Tile tile)
Returns the maximum zoom of a specific Tile.

Parameters

tile Tile
tile to check the max zoom

Returns

the max zoom of the tile