public abstract class

UrlTileProvider

extends Object
implements TileProvider
java.lang.Object
   ↳ com.amazon.geo.mapsv2.model.UrlTileProvider

Class Overview

An implementation of TileProvider that returns URLs to tiles, all of which must be the same size, for the map engine to download and cache as needed.

Summary

[Expand]
Inherited Fields
From interface com.amazon.geo.mapsv2.model.TileProvider
Public Constructors
UrlTileProvider(int width, int height)
Creates a new UrlTileProvider for images of the given width and height.
Public Methods
final Tile getTile(int x, int y, int zoom)
A UrlTileProvider always returns NO_TILE.
abstract URL getTileUrl(int x, int y, int zoom)
Method called by the map engine to retrieve a URL to an image for the given coordinates.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.amazon.geo.mapsv2.model.TileProvider

Public Constructors

public UrlTileProvider (int width, int height)

Creates a new UrlTileProvider for images of the given width and height.

Parameters
width The width, in pixels, for all images addressed by URLs returned from getTileUrl(int, int, int).
height The height, in pixels, for all images addressed by URLs returned from getTileUrl(int, int, int).

Public Methods

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

A UrlTileProvider always returns NO_TILE.

Parameters
x The x coordinate of the Tile to retrieve, in the closed range [0, 2zoom - 1].
y The y coordinate of the Tile to retrieve, in the closed range [0, 2zoom - 1].
zoom The zoom level of the Tile to retrieve, in the closed range [ AmazonMap.getMinZoomLevel(), AmazonMap.getMaxZoomLevel()].
Returns
  • The Tile to use for the given coordinates. Return NO_TILE if no tile exists for the coordinates. Return null if the tile for the coordinates is not currently available.

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

Method called by the map engine to retrieve a URL to an image for the given coordinates.

Parameters
x A horizontal world coordinate value from 0 to 2^zoom-1
y A vertical world coordinate value from 0 to 2^zoom-1
zoom The zoom level from getMinZoomLevel() to getMaxZoomLevel().
Returns
  • A URL to an image or null if there is no Tile for the given coordinates and/or zoom level. The engine attempts to download images from the provided URL on background threads and may attempt to download several images in parallel. Network failures may result in retries but the retries are limited and/or delayed by exponentially increasing time intervals.