LayerConfiguration

public struct LayerConfiguration : Hashable

A class to configure which layers should be enabled or disabled in the OCM map data. Disabling a layer allows to reduce the amount of data that will be downloaded or prefetched from the internet, for example, when panning the map view online or when downloading maps for offline use.

LayerConfiguration changes made via SDKOptions require sdk.maploader.MapUpdater to align previously downloaded content. To ensure that the changes in SDKOptions affect the map data, it is recommended to trigger a map update. Without calling mapUpdater.updateCatalog(...), the adjustments will apply only to future map downloads and will not impact the currently installed map data, either in the cache or in the persisted storage. Note that calling updateCatalog(...) will update the version, only when a map update is available in the catalog.

Notes

  • The LayerConfiguration is only available for the Navigate licenses that contains the offline maps feature. It has no effect on other license.

  • The LayerConfiguration cannot be set separately for a region, it will be applied globally for all regions that will be downloaded in the future.

  • It is not possible to specify a separate LayerConfiguration for the map cache and offline maps. The LayerConfiguration will be always applied to both.

  • If a LayerConfiguration is applied, then only the listed features will be enabled, all others will be disabled. For example, if you want to disable only one feature, then all other features need to be present, or they will be also disabled.

The LayerConfiguration controls which content will be subject of

  • map download for features in enabledFeatures(),
  • explicit prefetching using sdk.prefetcher.RoutePrefetcher, sdk.prefetcher.PolygonPrefetcher and implicit prefetching, such as when displaying a map view, for features in implicitlyPrefetchedFeatures().
  • Specifies feature configuration for enabling list of features enabled for map download. Empty list disables map download, as no map content specified for download in this case.

    Declaration

    Swift

    public var enabledFeatures: [LayerConfiguration.Feature]
  • Specifies the list of features enabled for implicit and explicit map prefetch. Implicit map prefetch will download map content for implicit prefetch features when showing a map in the MapView.

    Allows to specify an empty list, effectively disabling implicit prefetching. In this case, the system will prioritize minimal network usage, at the cost of reduced offline map availability. When disabling certain implicitly prefetched features, less data will be prefetched when the map is rendered. Map data that was already cached will not be removed until the least recently used strategy (LRU) applies. That means you cannot remove any content from the map cache by updating the LayerConfiguration. However, for new map data, it will be applied.

    By default the list contains:

    Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

    Declaration

    Swift

    public var implicitlyPrefetchedFeatures: [LayerConfiguration.Feature]
  • Initializes both, enabled_features and implicitly_prefetched_features with value passed to constructor.

    Declaration

    Swift

    public init(enabledFeatures: [LayerConfiguration.Feature])

    Parameters

    enabledFeatures

    List of map features to downloader through MapDownloader, and implicitly prefetch when using MapView

  • Defines a list of possible map data features that can be enabled / disabled. See SDKOptions.layerConfiguration

    Following features are enabled by default:

    All other features are disabled, by default.

    Each feature enables a set of OCM layer groups to be downloaded by sdk.maploader.MapDownloader. Detailed description of each layer group available in the HERE Optimized Client Map Developer Guide

    Following features are enabled by default for implicit prefetch:

    Implicit prefetch downloads map content for implicit prefetch features within a view port currently showed by MapView. Explicit prefetching is done using sdk.prefetcher.RoutePrefetcher and sdk.prefetcher.PolygonPrefetcher.

    Feature might have more than one layer group predefined to enable full experience. For example, LayerConfiguration.Feature.navigation requires routing attributes, visual-friendly street names, maneuvers data and ability to interconnect those data sets.

    The same map data is useful for different features, for example LayerConfiguration.Feature.rendering uses Places data to present it on the MapView, while LayerConfiguration.Feature.offlineSearch uses the same data to enable discoverability by name or category. Hence, features might have overlapping sets of enabled layer groups.

    See more

    Declaration

    Swift

    public enum Feature : UInt32, CaseIterable, Codable