public final class

TileOverlay

extends Object
java.lang.Object
   ↳ com.amazon.geo.mapsv2.model.TileOverlay

Class Overview

Represents a set of images placed on top of the normal base map tiles. The images can completely replace the standard map tiles. Alternatively, transparent tiles can add features to the standard map. Obtain the images for the TileOverlay from the given TileProvider.

Obtain a TileOverlay by creating a TileOverlayOptions object with the initial properties and then passing it to addTileOverlay(TileOverlayOptions).

You can change the properties of the TileOverlay using the setter methods after the TileOverlay is created. All getter and setter methods must be called on the main thread or an IllegalStateException is thrown.

The TileProvider must be set in the TileOverlayOptions and cannot be changed for an existing TileOverlay. To change the displayed tiles, you can either update your TileProvider internally and call clearTileCache(), or call remove() to remove the existing TileOverlay and then add another.

Tiles and Tile Coordinates

The world is projected with a Mercator projection. The map ranges from -180 to 180 degrees of longitude west to east. From north to south, the map is truncated at 85.05113 and -85.05113 degrees in order to make the map square.

The map world is divided into several square tiles that contain the map data. Low zoom levels show a small number of tiles and high zoom levels show many more tiles. For a zoom level N, the world is divided into 4N tiles arranged in a 2N x 2N grid. These tiles have x and y coordinates in the closed range [0, 2N - 1]. The tile in the top left (northwest) has the coordinate (0, 0) and the tile in the bottom right (southeast) has the coordinate (2N - 1, 2N - 1).

You can get the minimum zoom level with getMinZoomLevel() and the maximum zoom level with getMaxZoomLevel(). The map downloads and renders only the tiles that overlap the screen for the current zoom level.

Summary

Public Constructors
TileOverlay(ITileOverlayDelegate tileOverlayDelegate)
Public constructor.
Public Methods
void clearTileCache()
Clears the tile cache.
boolean equals(Object obj)
boolean getFadeIn()
Retrieves a boolean value indicating whether the tiles should fade in.
String getId()
Gets the unique ID for this TileOverlay.
float getZIndex()
Gets the z-index of this TileOverlay.
int hashCode()
boolean isVisible()
Retrieves a boolean value indicating whether the TileOverlay is visible or hidden.
void remove()
Removes this TileOverlay from the map.
void setFadeIn(boolean fadeIn)
Sets whether tiles should fade in or display instantly with no fade effect.
void setVisible(boolean visible)
Sets the visibility of the TileOverlay.
void setZIndex(float zIndex)
Sets the z-index of the TileOverlay.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TileOverlay (ITileOverlayDelegate tileOverlayDelegate)

Public constructor. Instead of using this constructor, use AmazonMap.addTileOverlay(TileOverlayOptions) to create a TileOverlay.

Public Methods

public void clearTileCache ()

Clears the tile cache. All tiles currently rendered are cleared from the map. Request new tiles by querying the TileProvider.

public boolean equals (Object obj)

public boolean getFadeIn ()

Retrieves a boolean value indicating whether the tiles should fade in.

Returns
  • true to fade in the tiles, or false to display the tiles instantly with no fade effect.

public String getId ()

Gets the unique ID for this TileOverlay. The ID is unique for all TileOverlay objects currently added to the map.

Returns
  • This TileOverlay's ID as a String.

public float getZIndex ()

Gets the z-index of this TileOverlay. See setZIndex(float) for more information about the z-index.

Returns
  • The TileOverlay's z-index.

public int hashCode ()

public boolean isVisible ()

Retrieves a boolean value indicating whether the TileOverlay is visible or hidden.

Returns
  • true if this TileOverlay is visible, or false if it is hidden.

public void remove ()

Removes this TileOverlay from the map. After calling this method, calling other methods on the object has no effect on the appearance of the map

public void setFadeIn (boolean fadeIn)

Sets whether tiles should fade in or display instantly with no fade effect.

Parameters
fadeIn true to fade in the tiles, or false to display the tiles instantly with no fade effect.

public void setVisible (boolean visible)

Sets the visibility of the TileOverlay. If false, the TileOverlay is hidden, but all state is preserved. The default value is true.

Parameters
visible true to make this TileOverlay visible, or false to make it hidden.

public void setZIndex (float zIndex)

Sets the z-index of the TileOverlay. Z-index determines the order in which overlays are drawn. Overlays with higher indices are drawn over overlays with lower indices. Overlays with the same z-index are drawn in an arbitrary order.

Overlays that are affected by z-index include GroundOverlay, TileOverlay, Circle, Polyline, and Polygon.

Marker overlays are not affected by the z-index of other overlays.

The default value is zero.

Parameters
zIndex The z-index.