HERE iOS SDK Developer's Guide

NMAMapTileLayer

Class Summary

class NMAMapTileLayer

Derived from: NSObject

A layer of custom raster tiles for display in an NMAMapView.

Include: NMAKit.framework/headers/NMAMapTileLayer.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAMapTileLayer

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, assign] NMAGeoBoundingBox boundingBox

Specifies the NMAGeoBoundingBox within which tiles will be requested and rendered.

[readable, assign] BOOL  cacheEnabled

Specifies whether tile bitmaps will be cached to disk by the framework.

[readable, assign] NSString *  cacheIdentifier

Identifier used to associate disk cached tile data with a NMAMapTileLayer instance to prevent clashes in the cache folder.

[readable, writable, assign] NSUInteger  cacheSizeLimit

Specifies the maximum size the cache will consume on disk.

[readable, writable, assign] NSTimeInterval  cacheTimeToLive

Specifies the cache expiration time in seconds.

[readable, writable, weak] id< NMAMapTileLayerDataSource dataSource

[readable, assign] BOOL  locked

Indicates if the tile layer is locked

[readable, writable, assign] NSUInteger  zIndex

Specifies the Z-index (stacking order) for the bitmap tiles within the map layer specified by the mapLayerType property.

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(void) clearCache

Clear the file system cache identified by the cacheIdentifier property

-(void) hideAtZoomLevel:(hide(atZoomLevel:)) NS_SWIFT_NAME

Hide the raster tiles at the specified zoom level.

-(void) hideFromZoomLevel:(int) fromLevel toZoomLevel:(hide(fromZoomLevel:toZoomLevel:)) NS_SWIFT_NAME

Hide the raster tiles at the specified zoom level range.

-(BOOL) isShownAtZoomLevel:(isShown(atZoomLevel:)) NS_SWIFT_NAME

Returns whether tiles are visisble at the specified zoom level.

-(void) setCacheEnabled:(BOOL) enabled withIdentifier:(setCache(enabled:identifier:)) NS_SWIFT_NAME

/brief Enable/Disable caching of tile data to disk

-(void) showAtZoomLevel:(show(atZoomLevel:)) NS_SWIFT_NAME

Show the raster tiles at the specified zoom level.

-(void) showFromZoomLevel:(int) fromLevel toZoomLevel:(show(fromZoomLevel:toZoomLevel:)) NS_SWIFT_NAME

Show the raster tiles at the specified zoom level range.

Class Details

A layer of custom raster tiles for display in an NMAMapView.

Raster tiles are supplied as bitmap data and can be supplied synchronously or simply by providing a URL from which to download the tiles from.

To use this class create an instance, configure the properties and call NMAMapView::addMapTileLayer.

Note:

IMPORTANT! The properties of this interface should not be modified after the instance has been added to an NMAMapView. See the NMAMapTileLayer::locked property.

Public Property Details

[readable, writable, assign] NMAGeoBoundingBoxboundingBox

Specifies the NMAGeoBoundingBox within which tiles will be requested and rendered.

Tiles falling fully outside the boundingBox will not be requested.

This property defaults to an unbounded value - i.e. tiles are rendered across the world.

Note:

This property cannot be set when the instance is locked. See NMAMapTileLayer::locked.

[readable, assign] BOOL cacheEnabled

Specifies whether tile bitmaps will be cached to disk by the framework.

File system caching is provided as a convenience. If caching is enabled tiles will not be re-requested via NMAMapTileLayerDelegate until they have expired.

This property defaults to NO. Caching is enabled by calling setCacheEnabled:withIdentifier:.

[readable, assign] NSString * cacheIdentifier

Identifier used to associate disk cached tile data with a NMAMapTileLayer instance to prevent clashes in the cache folder.

You must use unique cache identifiers to ensure there will be no filename clashes in the cache folder structure. It also allows you to easily identify the cache in the filesystem.

This property is set when you enable caching. See setCacheEnabled:withIdentifier:.

[readable, writable, assign] NSUInteger cacheSizeLimit

Specifies the maximum size the cache will consume on disk.

The framework may allow the cache size to grow an additional 5MB to the size specified in order to reduce disk access.

This property defaults to 0 which means the cache size is not limited.

Note:

This property has no effect if the cacheEnabled property is set to NO. Also, this property cannot be set when the instance is locked. See NMAMapTileLayer::locked.

[readable, writable, assign] NSTimeInterval cacheTimeToLive

Specifies the cache expiration time in seconds.

Tile bitmaps will expire cacheTimeToLive seconds after they have been downloaded causing them to be re-requested via NMAMapTileLayerDataSource when the map needs to render them.

This property defaults to 0 which means the cached tiles never expire.

Note:

This property has no effect if the cacheEnabled property is set to NO. Negative values will be reset to 0.

[readable, writable, weak] id< NMAMapTileLayerDataSourcedataSource

Data source that provides tile bitmap data for the NMAMapTileLayer

Note:

This property cannot be set when the instance is locked. See NMAMapTileLayer::locked.

[readable, assign] BOOL locked

Indicates if the tile layer is locked.

The tile layer is locked when it is added to an NMAMapView instance. While the tile layer is locked attempts to set any properties will be ignored. The tile layer is unlocked when it is removed from an NMAMapView instance.

[readable, writable, assign] NSUInteger zIndex

Specifies the Z-index (stacking order) for the bitmap tiles within the map layer specified by the mapLayerType property.

All objects within a map layer have a Z-index associated with them. Objects with the highest value are placed at the top of the stacking order. If two or more objects within a map layer have the same z-index value the their stacking order is undefind.

Z-index values range from NMAMapObjectMinimumZIndex to NMAMapObjectMaximumZIndex. The property will be clamped to this range if invalid values are specified.

This property defaults to NMAMapObjectMinimumZIndex.

Note:

This property cannot be set when the instance is locked. See NMAMapTileLayer::locked.

Instance Method Details

-(void) clearCache

Clear the file system cache identified by the cacheIdentifier property.

Note:

To guarantee the cache is cleared this method should be called after the NMAMapTileLayer instance has been removed from the NMAMapView

-(void) hideAtZoomLevel:(hide(atZoomLevel:)) NS_SWIFT_NAME

Hide the raster tiles at the specified zoom level.

You can control the tile visibility for each zoom level independently. For example, tiles may be visible at levels 0, 5, 7 only. Tiles are shown at all zoom levels by default.

Note:

This method does nothing when the instance is locked. See NMAMapTileLayer::locked.

Parameters:

  • zoomLevel

    Zoom level at which to hide the tiles. Values outside the range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored

-(void) hideFromZoomLevel:(int) fromLevel toZoomLevel:(hide(fromZoomLevel:toZoomLevel:)) NS_SWIFT_NAME

Hide the raster tiles at the specified zoom level range.

You can control the tile visibility for each zoom level independently. This method allows you set the visibility for a range of zoom levels in one call. Tiles are shown at all zoom levels by default.

The method will do nothing if ANY parameters fall outside the range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel or if fromLevel > toLevel.

Note:

This method does nothing when the instance is locked. See NMAMapTileLayer::locked.

Parameters:

  • fromLevel

    Lower zoom level index at which to hide the tiles. Values outside the range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored

  • toLevel

    Upper zoom level index at which to hide the tiles. Values outside the range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored

-(BOOL) isShownAtZoomLevel:(isShown(atZoomLevel:)) NS_SWIFT_NAME

Returns whether tiles are visisble at the specified zoom level.

You can control the tile visibility for each zoom level independently. This method allows you set the visibility for a range of zoom levels in one call. Tiles are shown at all zoom levels by default.

Parameters:

  • zoomLevel

    Zoom level. Values outside the range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will return NO.

Returns:

YES if tiles are shown at the specified zoom level, NO otherwise

-(void) setCacheEnabled:(BOOL) enabled withIdentifier:(setCache(enabled:identifier:)) NS_SWIFT_NAME

/brief Enable/Disable caching of tile data to disk.

File system caching is provided as a convenience. If caching is enabled tiles will not be re-requested via NMAMapTileLayerDelegate until they have expired.

It's important to always use the same cache identifier for your tile data. Otherwise, multiple disassociated cache folders will be created in the file system. This wastes disk space, and you will not benefit from persistent disk caching across sessions.

Note:

Calling this method changes the values of the cacheEnabled and cacheIdentifier properties.

Parameters:

  • cacheEnabled

    YES to enable caching, NO to disable.

  • cacheIdentifier

    You must use a unique cache identifier to ensure there will be no filename clashes in the cache folder structure. Passing a nil or empty string will result in caching NOT being enabled. The identifier is set the first time you call this method and will not be changed by subsequent calls to this method for the lifetime of the instance. If the identifier you supply contains non alphanumeric characters they will be stripped from the identifier, with the exception of "_" and "-".

-(void) showAtZoomLevel:(show(atZoomLevel:)) NS_SWIFT_NAME

Show the raster tiles at the specified zoom level.

You can control the tile visibility for each zoom level independently. For example, tiles may be visible at levels 0, 5, 7 only. Tiles are shown at all zoom levels by default.

Note:

This method does nothing when the instance is locked. See NMAMapTileLayer::locked.

Parameters:

  • zoomLevel

    Zoom level at which to show the tiles. Values outside the range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored

-(void) showFromZoomLevel:(int) fromLevel toZoomLevel:(show(fromZoomLevel:toZoomLevel:)) NS_SWIFT_NAME

Show the raster tiles at the specified zoom level range.

You can control the tile visibility for each zoom level independently. For example, tiles may be visible at levels 0, 5, 7 only. Tiles are shown at all zoom levels by default.

The method will do nothing if ANY parameters fall outside the range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel or if fromLevel > toLevel.

Note:

This method does nothing when the instance is locked. See NMAMapTileLayer::locked.

Parameters:

  • fromLevel

    Lower zoom level index at which to show the tiles. Values outside the range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored

  • toLevel

    Upper zoom level index at which to show the tiles. Values outside the range NMAMapViewMinimumZoomLevel..NMAMapViewMaximumZoomLevel will be ignored

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.