TileProvider
Stay organized with collections
Save and categorize content based on your preferences.
Known Indirect Subclasses
A partial implementation of TileProvider
that only requires a URL that points to an image to be provided.
An interface for a class that provides the tile images for a TileOverlay
.
For information about the tile coordinate system, see TileOverlay
.
Calls to methods in this interface might be made from multiple threads so implementations
of this interface must be threadsafe.
Field Summary
public static final Tile
|
NO_TILE
|
Stub tile that is used to indicate that no tile
exists for a specific tile coordinate. |
Public Method Summary
getTile
(int x, int y, int zoom) Returns the tile to be used for this tile coordinate.
Fields
public static final Tile
NO_TILE
Stub tile that is used to indicate that no tile exists for a specific tile
coordinate.
Public Methods
public abstract Tile
getTile
(int x, int y,
int zoom)
Returns the tile to be used for this tile coordinate.
Parameters
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eTileProvider\u003c/code\u003e is an interface for classes that provide tile images for a \u003ccode\u003eTileOverlay\u003c/code\u003e on a map.\u003c/p\u003e\n"],["\u003cp\u003eImplementations of this interface must be thread-safe as methods might be called from multiple threads.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetTile\u003c/code\u003e method is used to retrieve the tile image for a specific coordinate and zoom level.\u003c/p\u003e\n"],["\u003cp\u003eA special tile, \u003ccode\u003eNO_TILE\u003c/code\u003e, is provided to indicate that no tile exists for a given coordinate.\u003c/p\u003e\n"],["\u003cp\u003eIf a tile cannot be provided immediately, \u003ccode\u003enull\u003c/code\u003e can be returned, and the provider may be queried again later.\u003c/p\u003e\n"]]],["The `TileProvider` interface supplies tile images for a `TileOverlay`. Implementations must be thread-safe as method calls can occur from multiple threads. Key actions involve using the `getTile(int x, int y, int zoom)` method to retrieve a tile for a given coordinate, with 'x', 'y', and 'zoom' defining the tile's location. `NO_TILE` is a placeholder when no tile exists. `null` means tile is currently not found. `UrlTileProvider` is a subclass requiring a URL for the image.\n"],null,["# TileProvider\n\npublic interface **TileProvider** \n\n|---|---|---|\n| Known Indirect Subclasses [UrlTileProvider](/android/reference/com/google/android/gms/maps/model/UrlTileProvider) |-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [UrlTileProvider](/android/reference/com/google/android/gms/maps/model/UrlTileProvider) | A partial implementation of [TileProvider](/android/reference/com/google/android/gms/maps/model/TileProvider) that only requires a URL that points to an image to be provided. | |||\n\nAn interface for a class that provides the tile images for a [TileOverlay](/android/reference/com/google/android/gms/maps/model/TileOverlay).\nFor information about the tile coordinate system, see [TileOverlay](/android/reference/com/google/android/gms/maps/model/TileOverlay).\n\nCalls to methods in this interface might be made from multiple threads so implementations\nof this interface must be threadsafe. \n\n### Field Summary\n\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|\n| public static final [Tile](/android/reference/com/google/android/gms/maps/model/Tile) | [NO_TILE](/android/reference/com/google/android/gms/maps/model/TileProvider#NO_TILE) | Stub tile that is used to indicate that no tile exists for a specific tile coordinate. |\n\n### Public Method Summary\n\n|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Tile](/android/reference/com/google/android/gms/maps/model/Tile) | [getTile](/android/reference/com/google/android/gms/maps/model/TileProvider#getTile(int,%20int,%20int))(int x, int y, int zoom) Returns the tile to be used for this tile coordinate. |\n\nFields\n------\n\n#### public static final [Tile](/android/reference/com/google/android/gms/maps/model/Tile)\n**NO_TILE**\n\nStub tile that is used to indicate that no tile exists for a specific tile\ncoordinate.\n\nPublic Methods\n--------------\n\n#### public abstract [Tile](/android/reference/com/google/android/gms/maps/model/Tile)\n**getTile** (int x, int y, int zoom)\n\nReturns the tile to be used for this tile coordinate. \n\n##### Parameters\n\n| x | The x coordinate of the tile. This will be in the range \\[0, 2^zoom^ - 1\\] inclusive. |\n| y | The y coordinate of the tile. This will be in the range \\[0, 2^zoom^ - 1\\] inclusive. |\n| zoom | The zoom level of the tile. This will be in the range \\[ [GoogleMap.getMinZoomLevel](/android/reference/com/google/android/gms/maps/GoogleMap#getMinZoomLevel()), [GoogleMap.getMaxZoomLevel](/android/reference/com/google/android/gms/maps/GoogleMap#getMaxZoomLevel())\\] inclusive. |\n|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- the [Tile](/android/reference/com/google/android/gms/maps/model/Tile) to be used for this tile coordinate. If you do not wish to provide a tile for this tile coordinate, return [NO_TILE](/android/reference/com/google/android/gms/maps/model/TileProvider#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."]]