Class LayerConfiguration
Class LayerConfiguration
- java.lang.Object
-
- com.here.sdk.core.engine.LayerConfiguration
-
public final class LayerConfiguration extends java.lang.ObjectA 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.
LayerConfigurationchanges made viaSDKOptionsrequiresdk.maploader.MapUpdaterto align previously downloaded content. To ensure that the changes inSDKOptionsaffect the map data, it is recommended to trigger a map update. Without callingmapUpdater.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 callingupdateCatalog(...)will update the version, only when a map update is available in the catalog.Notes
- The
LayerConfigurationis only applicable for HERE SDK editions that contain the offline maps feature such as the Navigate Edition. It has no effect on other editions. - Only "OFFLINE_SEARCH", "OFFLINE_ROUTING", "TRUCK", "NAVIGATION", "RENDERING", "DETAIL_RENDERING" are enabled, by default. All other layers are disabled, by default. Note that the "RENDERING" layer is a base layer that cannot be disabled: Therefore, it is not necessary to explicitly add the layer to a feature configuration - it will be always enabled.
- The
LayerConfigurationcannot 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
LayerConfigurationfor the map cache and offline maps. TheLayerConfigurationwill be always applied to both. - If a
LayerConfigurationis 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
LayerConfigurationcontrols which content will be subject of- map download for features in
enabledFeatures(), - explicit prefetching using
sdk.prefetcher.RoutePrefetcher,sdk.prefetcher.PolygonPrefetcherand implicit prefetching, such as when displaying a map view, for features inimplicitlyPrefetchedFeatures().
- The
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLayerConfiguration.FeatureDefines a list of possible map data features that can be enabled / disabled.
-
Field Summary
Fields Modifier and Type Field Description java.util.List<LayerConfiguration.Feature>enabledFeaturesSpecifies feature configuration for enabling list of features enabled for map download.java.util.List<LayerConfiguration.Feature>implicitlyPrefetchedFeaturesSpecifies the list of features enabled for implicit and explicit map prefetch.
-
Constructor Summary
Constructors Constructor Description LayerConfiguration()Initializesenabled_features,implicitly_prefetched_featuresandon_demand_implicitly_prefetched_featureswith it's default values.LayerConfiguration(java.util.List<LayerConfiguration.Feature> enabledFeatures)Initializes both,enabled_featuresandimplicitly_prefetched_featureswith value passed to constructor.LayerConfiguration(java.util.List<LayerConfiguration.Feature> enabledFeatures, java.util.List<LayerConfiguration.Feature> implicitlyPrefetchedFeatures)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()
-
-
-
Field Detail
-
enabledFeatures
@NonNull public java.util.List<LayerConfiguration.Feature> enabledFeatures
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.
-
implicitlyPrefetchedFeatures
@NonNull public java.util.List<LayerConfiguration.Feature> implicitlyPrefetchedFeatures
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:
LayerConfiguration.Feature.DETAIL_RENDERINGLayerConfiguration.Feature.NAVIGATIONLayerConfiguration.Feature.OFFLINE_SEARCHLayerConfiguration.Feature.OFFLINE_ROUTINGLayerConfiguration.Feature.RENDERINGLayerConfiguration.Feature.TRUCK
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.
-
-
Constructor Detail
-
LayerConfiguration
public LayerConfiguration(@NonNull java.util.List<LayerConfiguration.Feature> enabledFeatures)Initializes both,
enabled_featuresandimplicitly_prefetched_featureswith value passed to constructor.- Parameters:
enabledFeatures-List of map features to downloader through
MapDownloader, and implicitly prefetch when usingMapView
-
LayerConfiguration
public LayerConfiguration()
Initializes
enabled_features,implicitly_prefetched_featuresandon_demand_implicitly_prefetched_featureswith it's default values.
-
LayerConfiguration
public LayerConfiguration(@NonNull java.util.List<LayerConfiguration.Feature> enabledFeatures, @NonNull java.util.List<LayerConfiguration.Feature> implicitlyPrefetchedFeatures)Creates a new instance.
- Parameters:
enabledFeatures-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.
implicitlyPrefetchedFeatures-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:
LayerConfiguration.Feature.DETAIL_RENDERINGLayerConfiguration.Feature.NAVIGATIONLayerConfiguration.Feature.OFFLINE_SEARCHLayerConfiguration.Feature.OFFLINE_ROUTINGLayerConfiguration.Feature.RENDERINGLayerConfiguration.Feature.TRUCK
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.
-
-