Class TiledProvider
java.lang.Object
com.codename1.maps.providers.MapProvider
com.codename1.maps.providers.TiledProvider
- Direct Known Subclasses:
GoogleMapsProvider, OpenStreetMapProvider
This is a tiled map provider
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTiledProvider(String url, Projection projection, Dimension tileSize) Creates a new Tiled provider -
Method Summary
Modifier and TypeMethodDescriptionReturns the bounding box of a position ina given zoom levelscale(int zoomLevel) Scale to the zoom leveltileFor(BoundingBox bbox) Gets a tile for the given bounding boxprotected Stringurl(int zoomLevel, int xTile, int yTile) build a url request for a tileMethods inherited from class MapProvider
attribution, maxZoomFor, maxZoomLevel, minZoomLevel, projection, tileSize, tileSize, translate
-
Field Details
-
_url
-
_zoomLevel
protected int _zoomLevel
-
-
Constructor Details
-
TiledProvider
Creates a new Tiled provider
Parameters
-
url: the url of the provider -
projection: the Projection system of the Provider -
tileSize: the tiles size(usually 256x256)
-
-
-
Method Details
-
url
build a url request for a tile
Parameters
-
zoomLevel: the zoom level -
xTile: x position of the tile -
yTile: y position of the tile
Returns
the image url of the tile
-
-
scale
Scale to the zoom level
Parameters
zoomLevel: to scale to
Returns
a scaled coordinate.
- Specified by:
scalein classMapProvider
-
bboxFor
Returns the bounding box of a position ina given zoom level
Parameters
-
position: on the map -
zoomLevel: the zoom level
Returns
a bounding box
- Specified by:
bboxForin classMapProvider
-
-
tileFor
Gets a tile for the given bounding box
Parameters
bbox: a bounding box
Returns
a Tile for the given bounding box
- Specified by:
tileForin classMapProvider
-