java.lang.Object | |
↳ | com.google.android.gms.maps.model.TileOverlay |
A Tile Overlay is a set of images which are displayed on top of the base map tiles. These tiles may be transparent, allowing you to add features to existing maps. A tile overlay has the following properties:
TileProvider
provides the images that are used in the tile overlay. You must
specify the tile provider before it is added to the map. The tile provider cannot be changed once
it has been added; however, you can modify the behavior of the tile provider to return different
images for specific coordinates. If the tiles provided by the tile provider change, you must call
clearTileCache()
afterwards to ensure that the previous tiles are no longer rendered.
GroundOverlay
s, Circle
s, Polyline
s, and Polygon
s but
not Marker
s). An overlay with a larger z-index is drawn over overlays with smaller
z-indices. The order of overlays with the same z-index is arbitrary. The default
zIndex is 0.true
, i.e., visible.
You must only call methods in this class on the main thread. Failure to do so will result in an
IllegalStateException
.
Note that the world is projected using the Mercator projection (see Wikipedia) with the left (west) side of the map corresponding to -180 degrees of longitude and the right (east) side of the map corresponding to 180 degrees of longitude. To make the map square, the top (north) side of the map corresponds to 85.0511 degrees of latitude and the bottom (south) side of the map corresponds to -85.0511 degrees of latitude. Areas outside this latitude range are not rendered.
At each zoom level, the map is divided into tiles and only the tiles that overlap the screen are downloaded and rendered. Each tile is square and the map is divided into tiles as follows:
GoogleMap.getMinZoomLevel
and
the maximum zoom level is GoogleMap.getMaxZoomLevel
.
The coordinates of the tiles are measured from the top left (northwest) corner of the map. At
zoom level N, the x
values of the tile coordinates range from 0 to 2N - 1 and
increase from west to east and the y
values range from 0 to 2N - 1 and
increase from north to south.
GoogleMap map; // ... get a map.
TileProvider tileProvider; // ... create a tile provider.
TileOverlay tileOverlay = map.addTileOverlay(
new TileOverlayOptions().tileProvider(tileProvider));
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clears the tile cache so that all tiles will be requested again from the
TileProvider . | |||||||||||
Gets this tile overlay's id.
| |||||||||||
Gets the zIndex of this tile overlay.
| |||||||||||
Gets the visibility of this tile overlay.
| |||||||||||
Removes this tile overlay from the map.
| |||||||||||
Sets the visibility of this tile overlay.
| |||||||||||
Sets the zIndex of this tile overlay.
|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Clears the tile cache so that all tiles will be requested again from the
TileProvider
. The current tiles from this tile overlay will also be cleared from the
map after calling this.
Gets this tile overlay's id.
Gets the zIndex of this tile overlay.
Gets the visibility of this tile overlay. Note that this does not return whether the tile overlay is actually within the screen's viewport, but whether it will be drawn if it is contained in the screen's viewport.
Removes this tile overlay from the map.
Sets the visibility of this tile overlay. When not visible, a tile overlay is not drawn, but it keeps all its other properties.
visible | if true , then the tile overlay is visible; if false , it is
not.
|
---|
Sets the zIndex of this tile overlay. See the documentation at the top of this class for more information.
zIndex | the zIndex of this tile overlay. |
---|