public abstract class TiledProvider

  1. Object
  2. MapProvider
  3. TiledProvider

Known subtypesGoogleMapsProvider, OpenStreetMapProvider

This is a tiled map provider

Fields

protected final String _url
protected int _zoomLevel

Constructors

public TiledProvider(String url, Projection projection, Dimension tileSize)Creates a new Tiled provider

Methods

protected String url(int zoomLevel, int xTile, int yTile)build a url request for a tile
public Coord scale(int zoomLevel)Scale to the zoom level
public BoundingBox bboxFor(Coord position, int zoomLevel)Returns the bounding box of a position ina given zoom level
public Tile tileFor(BoundingBox bbox)Gets a tile for the given bounding box

Inherited methods

Field details

_url

protected final String _url

_zoomLevel

protected int _zoomLevel

Constructor details

TiledProvider

public TiledProvider(String url, Projection projection, Dimension tileSize)
Creates a new Tiled provider

Parameters

url String
the url of the provider
projection Projection
the Projection system of the Provider
tileSize Dimension
the tiles size(usually 256x256)

Method details

url

protected String url(int zoomLevel, int xTile, int yTile)
build a url request for a tile

Parameters

zoomLevel int
the zoom level
xTile int
x position of the tile
yTile int
y position of the tile

Returns

the image url of the tile

scale

public Coord scale(int zoomLevel)
Scale to the zoom level

Parameters

zoomLevel int
to scale to

Returns

a scaled coordinate.

bboxFor

public 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 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