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.

Constructor Summary

Table 2. Constructors in MapRasterTileSource
Constructors

MapRasterTileSource ()

Constructor.

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 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 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 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 ()

Constructor.

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 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 MapRasterTileSource hideAtZoomLevel (int level)

Hides tiles at the specified zoom level of the Map .

Parameters:

  • level

    Zoom level at which tiles are to be hidden

Returns:

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

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

  • 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

Returns:

True if raster tiles are shown at the specified zoom level, false otherwise (see getZoomLevel() to retrieve the current zoom level of the Map).

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 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:

  • level

    Zoom level at which tiles are to be shown

Returns:

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

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

  • 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).

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.