Class MapProvider
java.lang.Object
com.codename1.maps.providers.MapProvider
- Direct Known Subclasses:
TiledProvider
This is a generic map provider.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMapProvider(Projection p, Dimension tileSize) Creates a new MapProvider -
Method Summary
Modifier and TypeMethodDescriptionabstract StringThe provider attribution.abstract BoundingBoxReturns the bounding box of a position ina given zoom levelintmaxZoomFor(Tile tile) Returns the maximum zoom of a specific Tile.abstract intMaximal zoom level.intMinimal zoom level user is able to see.Gets the Provider projectionabstract Coordscale(int zoomLevel) Scale is the distance in map units between each pixel in tile at given zoom level.abstract TiletileFor(BoundingBox bbox) Gets a tile for the given bounding boxtileSize()Gets the tile sizevoidRequest map to provide tiles of specific sizes.Translates position by [pixelsX, pixelsY] at zoomLevel acordingly to maps scale.
-
Constructor Details
-
MapProvider
Creates a new MapProvider
Parameters
-
p: the projection system -
tileSize: the tile size
-
-
-
Method Details
-
tileSize
Request map to provide tiles of specific sizes. May not be supported by map provider. By default it does nothing;
Parameters
size: requested tile size
-
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
-
-
tileFor
Gets a tile for the given bounding box
Parameters
bbox: 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
Scale is the distance in map units between each pixel in tile at given zoom level.
Returns
Scale at given zoom level.
-
translate
-
projection
Gets the Provider projection
Returns
the Provider projection
-
tileSize
Gets the tile size
Returns
the tile size
-
attribution
The provider attribution.
Returns
a String of the provider attribution
-
maxZoomFor
Returns the maximum zoom of a specific Tile.
Parameters
tile: tile to check the max zoom
Returns
the max zoom of the tile
-