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, translateModifier and TypeMethodDescriptionabstract StringThe provider attribution.intmaxZoomFor(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 projectiontileSize()Gets the tile sizevoidRequest map to provide tiles of specific sizes.Translates position by [pixelsX, pixelsY] at zoomLevel acordingly to maps scale.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
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
-