HERE iOS SDK Developer's Guide

NMAMapDataPrefetcher

Class Summary

class NMAMapDataPrefetcher

Derived from: NSObject

NMAMapDataPrefetcher is a class is used to prefetch map data for an area of interest.

Include: NMAKit.framework/headers/NMAMapDataPrefetcher.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAMapDataPrefetcher

[For complete information, see the section Class Details]

Instance Method Summary

Table 1. Instance Methods
Instance Method Summary

-(void) addListener:(nonnull id< NMAMapDataPrefetcherListener >) listener

-(void) cancel:(NSInteger) requestId

-(void) cancelAll

-(void) clearMapDataCache

-(NSInteger) estimateMapDataSizeForBoundingBox:(nonnull NMAGeoBoundingBox *) boundingBox error:( NMAPrefetchRequestError *_Nullable) error

Estimate the data size for fetching the map data for an area bounded by a box

-(NSInteger) estimateMapDataSizeForRoute:(nonnull NMARoute *) route radius:(NSUInteger) radius error:( NMAPrefetchRequestError *_Nullable) error

Estimate the data size for fetching the map data for an area by specifying a route

-(NSInteger) fetchMapDataForBoundingBox:(nonnull NMAGeoBoundingBox *) boundingBox error:( NMAPrefetchRequestError *_Nullable) error

-(NSInteger) fetchMapDataForRoute:(nonnull NMARoute *) route radius:(NSUInteger) radius error:( NMAPrefetchRequestError *_Nullable) error

-(nonnull instancetype) init

-(void) removeListener:(nonnull id< NMAMapDataPrefetcherListener >) listener

Class Method Summary

Table 2. Class Methods
Class Methods

+(nonnull instancetype) new

+(nonnull NMAMapDataPrefetcher *) sharedMapDataPrefetcher

Returns the NMAMapDataPrefetcher singleton instance

Class Details

NMAMapDataPrefetcher is a class is used to prefetch map data for an area of interest. This is similar to the NMAMapLoader except the map data of interest is specified by a NMAGeoBoundingBox or NMARoute, rather than NMAMapPackages. This allows scenarios such as guidance to work in a specific area reliably even though the network might be offline at that time.

Instance Method Details

-(void) addListener:(nonnull id< NMAMapDataPrefetcherListener >) listener

-(void) cancel:(NSInteger) requestId

-(void) cancelAll

-(void) clearMapDataCache

-(NSInteger) estimateMapDataSizeForBoundingBox:(nonnull NMAGeoBoundingBox *) boundingBox error:( NMAPrefetchRequestError *_Nullable) error

Estimate the data size for fetching the map data for an area bounded by a box. When the data size estimation is completed, the prefetcher will notify the listeners with the size in KB if successful. See NMAMapDataPrefetcherListenerdidEstimate:forRequestId:withSuccess:::prefetcher:didEstimate:forRequestId:withSuccess:.

The same data groups as NMAMapLoader are fetched by NMAMapDataPrefetcher and are the same data groups used for the estimation. To specify which data groups to fetch: See NMAMapLoader::selectDataGroup: See NMAMapLoader::deselectDataGroup:

Parameters:

  • boundingBox

    An area to fetch the map data for.

  • error

    an NMAPrefetchRequestError is provided to indicate any failures submitting a request.

Returns:

a request id. For any invalid request, the id will be less than 0.

-(NSInteger) estimateMapDataSizeForRoute:(nonnull NMARoute *) route radius:(NSUInteger) radius error:( NMAPrefetchRequestError *_Nullable) error

Estimate the data size for fetching the map data for an area by specifying a route. When the data size estimation is completed, the prefetcher will notify the listeners with the size in KB if successful. See NMAMapDataPrefetcherListenerdidEstimate:forRequestId:withSuccess:::prefetcher:didEstimate:forRequestId:withSuccess:.

The same data groups as NMAMapLoader are fetched by NMAMapDataPrefetcher and are the same data groups used for the estimation. To specify which data groups to fetch: See NMAMapLoader::selectDataGroup: See NMAMapLoader::deselectDataGroup:

Note:

Not supported for NMATransitRoute and NMAUrbanMobilityRoute routes. The method will fail with an NMAPrefetchRequestErrorInvalidParameters error.

Parameters:

  • route

    Route to fetch map data around.

  • radius

    Distance around route to fetch map data for in meters. Data is fetched as a series of circular areas with their centers along the route with the specified radius. The absolute minimum distance is 500m, otherwise NMAPrefetchRequestErrorInvalidParameters will be returned.

  • error

    an NMAPrefetchRequestError is provided to indicate any failures submitting a request.

Returns:

a request id. For any invalid request, the id will be less than 0.

-(NSInteger) fetchMapDataForBoundingBox:(nonnull NMAGeoBoundingBox *) boundingBox error:( NMAPrefetchRequestError *_Nullable) error

-(NSInteger) fetchMapDataForRoute:(nonnull NMARoute *) route radius:(NSUInteger) radius error:( NMAPrefetchRequestError *_Nullable) error

-(nonnull instancetype) init

Instances of this class should not be initialized directly

-(void) removeListener:(nonnull id< NMAMapDataPrefetcherListener >) listener

Class Method Details

+(nonnull instancetype) new

Instances of this class should not be initialized directly

+(nonnull NMAMapDataPrefetcher *) sharedMapDataPrefetcher

Returns the NMAMapDataPrefetcher singleton instance.

Note:

Use this method to obtain a NMAMapDataPrefetcher instance.

Returns:

shared NMAMapDataPrefetcher instance