HERE Android SDK Developer's Guide

MapRasterTileSource

The class MapRasterTileSource is a member of com.here.android.mpa.mapping .

Class Summary

public abstract class MapRasterTileSource

extends java.lang.Object

Represents an interface for a map raster tile source, used to render custom tile images on top of a Map.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in MapRasterTileSource
Nested Classes

public static final class MapRasterTileSource.MapTileSystemHelper

Represents a helper class for converting raster tile coordinates to other tile system values.

public static class MapRasterTileSource.TileResult

Result class for getting tile.

public static final enumeration MapRasterTileSource.Transparency

Represents values describing the state of raster tile image transparency.

Constructor Summary

Table 2. Constructors in MapRasterTileSource
Constructors

MapRasterTileSource ()

Method Summary

Table 3. Methods in MapRasterTileSource
Methods

public GeoBoundingBox getBoundingArea ()

Gets the GeoBoundingBox representing the bounding area within which raster tiles are visible.

public int getCacheExpiration ()

Get the cache expiration time

public MapOverlayType getOverlayType ()

Gets the raster tile overlay type.

public int getTileSize ()

Gets the raster tile image size, in pixels.

public TileResult getTileWithError (int x, int y, int zoomLevel)

Method to be overwritten by derived class to get a tile.

public int getZIndex ()

Gets the current z-index (stacking order) of the MapObject .

public abstract boolean hasTile (int x, int y, int zoomLevel)

Abstract method to be overwritten by derived class to check if a tile exists.

public boolean hasTransparency ()

Determines whether raster tile images have transparency enabled.

public MapRasterTileSource hideAtZoomLevel (int level)

Hides tiles at the specified zoom level of the Map .

public MapRasterTileSource hideAtZoomRange (int beginZoomLevel, int endZoomLevel)

Hides tiles within a given zoom level range of the Map .

public boolean isCachingEnabled ()

Get whether tiles are cached to the file system

public boolean isShownAtZoomLevel (int zoomLevel)

Determines whether raster tiles are shown at the specified zoom level of the Map .

public MapRasterTileSource setBoundingArea (GeoBoundingBox boundingBox)

Sets a bounding area within which raster tiles are visible.

public MapRasterTileSource setCacheExpiration (int expireSeconds)

Set the cache expiration time

public MapRasterTileSource setCachePrefix (String cache)

Set the cache file prefix

public MapRasterTileSource setCachingEnabled (boolean enabled)

Set whether tiles are cached to the file system.

public MapRasterTileSource setOverlayType (MapOverlayType newValue)

Sets a MapOverlayType for the MapRasterTileSource .

public MapRasterTileSource setTileSize (int newValue)

Sets a size, in pixels, for the raster tile image.

public MapRasterTileSource setTransparency (Transparency value)

Sets a Transparency state for raster tile image.

public MapRasterTileSource setZIndex (int zIndex)

Sets a z-index (stacking order) value for the MapObject .

public MapRasterTileSource showAtZoomLevel (int level)

Shows tiles at the specified zoom level of the Map .

public MapRasterTileSource showAtZoomRange (int beginZoomLevel, int endZoomLevel)

Shows tiles within a given zoom level range of the Map .

Class Details

Represents an interface for a map raster tile source, used to render custom tile images on top of a Map.

Default attribute values are as follows:


  Overlay type:    RasterTileOverlayType.BACKGROUND_REPLACEMENT
  Transparency:    Transparency.TRANSPARENCY_ON
  Tile size:     256x256 pixels
  Valid zoom levels: 0-20 (all zoom levels)
  Bounding area:   Top-Left coordinate: (-180.0, 90.0), Bottom-Right coordinate: (179.99, -90.0)
  

Note: the currently supported pixel format for the tile images is RGBA.

Constructor Details

MapRasterTileSource ()

Method Details

public GeoBoundingBox getBoundingArea ()

Gets the GeoBoundingBox representing the bounding area within which raster tiles are visible.

Returns:

The raster tile bounding area

public int getCacheExpiration ()

Get the cache expiration time

Returns:

Expire time in seconds

public MapOverlayType getOverlayType ()

Gets the raster tile overlay type.

Returns:

The raster tile overlay type, a MapOverlayType value

public int getTileSize ()

Gets the raster tile image size, in pixels.

Returns:

The size of the raster tile image

public TileResult getTileWithError (int x, int y, int zoomLevel)

Method to be overwritten by derived class to get a tile.

Parameters:

  • x

    X coordinate

  • y

    Y coordinate

  • zoomLevel

    zoom level

Returns:

A TileResult representing tile data and operation error. Check TileResult#getError() to check for error. Check TileResult#getData() to get RasterTile

public int getZIndex ()

Gets the current z-index (stacking order) of the MapObject .

Returns:

The current ordinal z-index number

public abstract boolean hasTile (int x, int y, int zoomLevel)

Abstract method to be overwritten by derived class to check if a tile exists.

Parameters:

  • x

    X coordinate

  • y

    Y coordinate

  • zoomLevel

    zoom level

Returns:

true if the tile exists, false otherwise

public boolean hasTransparency ()

Determines whether raster tile images have transparency enabled.

Returns:

True if raster tile images are set to Transparency.TRANSPARENCY_ON, false otherwise

public MapRasterTileSource hideAtZoomLevel (int level)

Hides tiles at the specified zoom level of the Map .

Parameters:

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource hideAtZoomRange (int beginZoomLevel, int endZoomLevel)

Hides tiles within a given zoom level range of the Map .

Parameters:

  • beginZoomLevel

    Zoom level representing the beginning of the range within which tiles are to be hidden (see getMaxZoomLevel() and getMinZoomLevel() to retrieve the supported zoom level range).

  • endZoomLevel

    Zoom level representing the end of the range within which tiles are to be hidden

Returns:

The updated MapRasterTileSource itself (see getMaxZoomLevel() and getMinZoomLevel() to retrieve the supported zoom level range).

public boolean isCachingEnabled ()

Get whether tiles are cached to the file system

Returns:

True of tiles are cached. False otherwise.

public boolean isShownAtZoomLevel (int zoomLevel)

Determines whether raster tiles are shown at the specified zoom level of the Map .

Parameters:

  • zoomLevel

    Zoom level to check for raster tile visibility (see getZoomLevel() to retrieve the current zoom level of the Map).

Returns:

True if raster tiles are shown at the specified zoom level, false otherwise

public MapRasterTileSource setBoundingArea (GeoBoundingBox boundingBox)

Sets a bounding area within which raster tiles are visible.

Parameters:

  • boundingBox

    A GeoBoundingBox representing the bounding area of visible raster tiles

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource setCacheExpiration (int expireSeconds)

Set the cache expiration time

Parameters:

  • expireSeconds

    Expire time in seconds

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource setCachePrefix (String cache)

Set the cache file prefix

Parameters:

  • cache

    Prefix tag

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource setCachingEnabled (boolean enabled)

Set whether tiles are cached to the file system.

Parameters:

  • enabled

    True to cache, False otherwise

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource setOverlayType (MapOverlayType newValue)

Sets a MapOverlayType for the MapRasterTileSource .

Parameters:

  • newValue

    A MapOverlayType value representing the desired raster tile overlay type

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource setTileSize (int newValue)

Sets a size, in pixels, for the raster tile image.

Parameters:

  • newValue

    Desired size of the raster tile image

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource setTransparency (Transparency value)

Sets a Transparency state for raster tile image.

Parameters:

  • value

    A Transparency value representing the desired raster tile image transparency

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource setZIndex (int zIndex)

Sets a z-index (stacking order) value for the MapObject .

Parameters:

  • zIndex

    A new z-index value for the MapObject, a 16-bit int within the range of [0..655xx]

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource showAtZoomLevel (int level)

Shows tiles at the specified zoom level of the Map .

Parameters:

Returns:

The updated MapRasterTileSource itself.

public MapRasterTileSource showAtZoomRange (int beginZoomLevel, int endZoomLevel)

Shows tiles within a given zoom level range of the Map .

Parameters:

  • beginZoomLevel

    Zoom level representing the beginning of the range within which tiles are to be shown (see getMaxZoomLevel() and getMinZoomLevel() to retrieve the supported zoom level range).

  • endZoomLevel

    Zoom level representing the end of the range within which tiles are to be shown

Returns:

The updated MapRasterTileSource itself (see getMaxZoomLevel() and getMinZoomLevel() to retrieve the supported zoom level range).