CompositeRegionsUpdater
public final class CompositeRegionsUpdater
A helper class that facilitates the map-management activities on regions in a group-level.
It provides a simplified graph of regions for UI visualization, and various functions to allow performing map operations on these regions.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Declaration
Swift
public convenience init(ndsStoreUpdater: NDSStoreUpdater)Parameters
ndsStoreUpdaterThe
NDSStoreUpdaterthat contains the offline map data.
-
Adds an observer for information about the
CompositeRegionGraphand the state information.The first observer that is added triggers the process of determining the
CompositeRegionGraph. If the map regions cannot be determined,CompositeRegionObserver.onCompositeRegionGraphChangedwill be called with an error. The observer will be called when and if the error is resolved.Declaration
Swift
public func addCompositeRegionObserver(_ observer: CompositeRegionObserver)Parameters
observerThe observer to be added.
-
Removes the given observer.
This call is a no-op if the given listener was not added earlier.
Declaration
Swift
public func removeCompositeRegionObserver(_ observer: CompositeRegionObserver)Parameters
observerThe observer to be removed.
-
Schedules the given operations to be performed on the offline map.
Declaration
Swift
public func schedule(operations: [CompositeRegionOperation])Parameters
operationsThe operations to be performed on the offline map.
-
Requests the cancellation of all operations scheduled with
schedule(operations:)for the specifiedCompositeRegions.Declaration
Swift
public func cancelAllMapOperations(for regionIDs: [CompositeRegionID])Parameters
regionIDsThe list of
CompositeRegionIDs that were previously passed toschedule(operations:)to schedule an operation. -
Finds the lowest-level of the parent
CompositeRegions that contains the givenRegionGraphNodeIDFor the following region graph as an example,
findCompositeRegions(regionGraphNodeID: 3)will returnSubRegion_0andCountry_1. Because thoseCompositeRegions are the lowest non-leaf regions with theRegionGraphNodewithRegionGraphNodeID3.Continental: 0, 1, 2, 3, 4, 5, 6, 7 |--- Country_0: 1, 2, 3, 4 | |--- SubRegion_0: 1, 2, 3 | |--- LeafRegion_0: 1 | |--- LeafRegion_1: 2 | |--- SharedLeafRegion_0: 3 | |--- SubRegion_1: 4 | |--- LeafRegion_2: 4 |--- Country_1: 3, 5, 6, 7 | |--- LeafRegion_3: 5 | |--- LeafRegion_4: 6 | |--- LeafRegion_5: 7 | |--- SharedLeafRegion_0: 3Declaration
Swift
public func findCompositeRegions(regionGraphNodeID: RegionGraphNodeID) -> Set<CompositeRegion>Parameters
regionGraphNodeIDThe region graph node ID that can be from
NDSStore/findRegionsAroundPosition(position:radius:callback:)Return Value
a set of
CompositeRegions. -
Calculates the uninstallation size of the specified composite regions.
Note
The calculated size may not be accurate if any composite region is currently undergoing a map operation.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func calculateUninstallSize( compositeRegionIDs: Set<CompositeRegionID>, completion: @escaping (Result<Measurement<UnitInformationStorage>, MapUpdateError>) -> () ) -> CancellableParameters
compositeRegionIDsThe set of
CompositeRegionIDfor calculating the uninstall size. If anyCompositeRegionIDdoes not exist in theCompositeRegionGraph,completionwill be called with theMapUpdateError/invalidArgumenterror.completionInvoked when the operation has been finished either successfully or unsuccessfully (with an error). It is executed on the main thread.
Return Value
The
Cancellableoperation.
TomTom SDK for iOS (0.73.0-rc04)
CompositeRegionsUpdater