UrlTileProvider | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
Summary: Inherited Fields | Ctors | Methods | Inherited Methods | [Expand All]
public abstract class

# UrlTileProvider

extends Object
implements TileProvider

java.lang.Object
↳ | com.google.android.gms.maps.model.UrlTileProvider

## Class Overview

A partial implementation of `TileProvider` that only requires a URL that points to an image to be provided.

Note that this class requires that all the images have the same dimensions.

## Summary

[Expand] Inherited Fields
From interface com.google.android.gms.maps.model.TileProvider
public static final Tile | NO_TILE | Stub tile that is used to indicate that no tile exists for a specific tile coordinate.

Public Constructors
| UrlTileProvider(int width, int height) Constructs a UrlTileProvider.

Public Methods
final Tile | getTile(int x, int y, int zoom) Returns the tile to be used for this tile coordinate.
abstract URL | getTileUrl(int x, int y, int zoom) Returns a `URL` that points to the image to be used for this tile.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
From interface com.google.android.gms.maps.model.TileProvider
abstract Tile | getTile(int x, int y, int zoom) Returns the tile to be used for this tile coordinate.

## Public Constructors

#### public UrlTileProvider (int width, int height)

Constructs a UrlTileProvider.

##### Parameters

width | width of the images used for tiles
height | height of the images used for tiles

## Public Methods

#### public final Tile getTile (int x, int y, int zoom)

Returns the tile to be used for this tile coordinate.

##### Parameters

x | The x coordinate of the tile. This will be in the range [0, 2zoom - 1] inclusive.
y | The y coordinate of the tile. This will be in the range [0, 2zoom - 1] inclusive.
zoom | The zoom level of the tile. This will be in the range [ `GoogleMap.getMinZoomLevel`, `GoogleMap.getMaxZoomLevel`] inclusive.

##### Returns

- the `Tile` to be used for this tile coordinate. If you do not wish to provide a tile for this tile coordinate, return `NO_TILE`. If the tile could not be found at this point in time, return null and further requests might be made with an exponential backoff.

#### public abstract URL getTileUrl (int x, int y, int zoom)

Returns a `URL` that points to the image to be used for this tile. If no image is found on the initial request, further requests will be made with an exponential backoff. If you do not wish to provide an image for this tile coordinate, return null.

##### Parameters

x | The x coordinate of the tile. This will be in the range [0, 2zoom - 1] inclusive.
y | The y coordinate of the tile. This will be in the range [0, 2zoom - 1] inclusive.
zoom | The zoom level of the tile. This will be in the range [ `GoogleMap.getMinZoomLevel`, `GoogleMap.getMaxZoomLevel`] inclusive.

##### Returns

- URL a `URL` that points to the image to be used for this tile. If you do not wish to provide an image for this tile coordinate, return `null`.