public final class **TileOverlay** extends Object  
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:

Tile Provider
:   The `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/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 `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#clearTileCache()` afterwards to ensure that the
    previous tiles are no longer rendered.

Z-Index
:   The order in which this tile overlay is drawn with respect to other overlays (including
    `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/GroundOverlay`s, `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/Circle`s, `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/Polyline`s, and `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/Polygon`s but not
    `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/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.

Transparency
:   Transparency of the tile overlay in the range `[0..1]` where `0` means the
    overlay is opaque and `1` means the overlay is fully transparent. If the specified
    bitmap is already partially transparent, the transparency of each pixel will be scaled
    accordingly (for example, if a pixel in the bitmap has an alpha value of 200 and you
    specify the transparency of the tile overlay as 0.25, then the pixel will be rendered on
    the screen with an alpha value of 150). Specification of this property is optional and the
    default transparency is 0 (opaque).

Visibility
:   Indicates if the tile overlay is visible or invisible, i.e., whether it is drawn on the
    map. An invisible tile overlay is not drawn, but retains all of its other properties. The
    default is `true`, i.e., visible.

You must only call methods in this class on the main thread. Failure to do so will result in
an `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/reference/java/lang/IllegalStateException.html`.

### Tile Coordinates

Note that the world is projected using the Mercator projection (see [Wikipedia](http://en.wikipedia.org/wiki/Mercator_projection)) 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:

- At zoom level 0, one tile represents the entire world. The coordinates of that tile are (x, y) = (0, 0).
- At zoom level 1, the world is divided into 4 tiles arranged in a 2 x 2 grid.
- ...
- At zoom level N, the world is divided into 4^N^ tiles arranged in a 2^N^ x 2^N^ grid.

Note that the minimum zoom level that the camera supports (which can depend on various factors) is `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/GoogleMap#getMinZoomLevel()` and the maximum zoom level is `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/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 2^N^ - 1 and
increase from west to east and the `y` values range from 0 to 2^N^ - 1 and
increase from north to south.

### Example

    GoogleMap map; // ... get a map.
     TileProvider tileProvider; // ... create a tile provider.
     TileOverlay tileOverlay = map.addTileOverlay(
         new TileOverlayOptions().tileProvider(tileProvider));
     
<br />

### Public Method Summary

|---|---|
| void | [clearTileCache](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#clearTileCache())() Clears the tile cache so that all tiles will be requested again from the `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileProvider`. |
| boolean | [equals](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#equals(java.lang.Object))(Object other) Tests if this `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay` is equal to another. |
| boolean | [getFadeIn](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#getFadeIn())() Gets whether the overlay tiles should fade in. |
| String | [getId](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#getId())() Gets this tile overlay's id. |
| float | [getTransparency](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#getTransparency())() Gets the transparency of this tile overlay. |
| float | [getZIndex](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#getZIndex())() Gets the zIndex of this tile overlay. |
| int | [hashCode](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#hashCode())() |
| boolean | [isVisible](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#isVisible())() Gets the visibility of this tile overlay. |
| void | [remove](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#remove())() Removes this tile overlay from the map. |
| void | [setFadeIn](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#setFadeIn(boolean))(boolean fadeIn) Sets whether the overlay tiles should fade in. |
| void | [setTransparency](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#setTransparency(float))(float transparency) Sets the transparency of this tile overlay. |
| void | [setVisible](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#setVisible(boolean))(boolean visible) Sets the visibility of this tile overlay. |
| void | [setZIndex](https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay#setZIndex(float))(float zIndex) Sets the zIndex of this tile overlay. |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public void
**clearTileCache**
()

Clears the tile cache so that all tiles will be requested again from the `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileProvider`.
The current tiles from this tile overlay will also be cleared from the map after calling this
method. The API maintains a small in-memory cache of tiles. If you want to cache tiles for
longer, you should implement an on-disk cache.

#### public boolean
**equals**
(Object other)

Tests if this `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/model/TileOverlay` is equal to another.

##### Parameters

| other | an `https://developers.google.com/maps/documentation/navigation/android-sdk/reference/com/google/android/gms/maps/reference/java/lang/Object.html`. |
|---|---|

##### Returns

- true if both objects are the same object, that is, this == other.

#### public boolean
**getFadeIn**
()

Gets whether the overlay tiles should fade in.

##### Returns

- `true` if the tiles are to fade in; `false` if they are not.

#### public String
**getId**
()

Gets this tile overlay's id.

#### public float
**getTransparency**
()

Gets the transparency of this tile overlay.

##### Returns

- the transparency of this tile overlay.

#### public float
**getZIndex**
()

Gets the zIndex of this tile overlay.

##### Returns

- the zIndex of the tile overlay.

#### public int
**hashCode**
()

<br />

#### public boolean
**isVisible**
()

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.

##### Returns

- this tile overlay's visibility.

#### public void
**remove**
()

Removes this tile overlay from the map.

#### public void
**setFadeIn**
(boolean fadeIn)

Sets whether the overlay tiles should fade in.

##### Parameters

| fadeIn | `true` to make the tiles fade in; `false` to render them instantly. |
|---|---|

#### public void
**setTransparency**
(float transparency)

Sets the transparency of this tile overlay. See the documentation at the top of this class for
more information.

##### Parameters

| transparency | a float in the range `[0..1]` where `0` means that the tile overlay is opaque and `1` means that the tile overlay is transparent. |
|---|---|

#### public void
**setVisible**
(boolean visible)

Sets the visibility of this tile overlay. When not visible, a tile overlay is not drawn, but it
keeps all its other properties. Tile overlays are visible by default.

##### Parameters

| visible | `true` to make this overlay visible; `false` to make it invisible. |
|---|---|

#### public void
**setZIndex**
(float zIndex)

Sets the zIndex of this tile overlay. See the documentation at the top of this class for more
information.

##### Parameters

| zIndex | the zIndex of this tile overlay. |
|---|---|