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.-
Adds an observer for information about the
CompositeRegionGraph
and the state information.The first observer that is added triggers the process of determining the
CompositeRegionGraph
. If the map regions cannot be determined,CompositeRegionObserver.onCompositeRegionGraphChanged
will 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
observer
The 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
observer
The observer to be removed.
-
Schedules the given operations to be performed on the offline map.
Declaration
Swift
public func schedule(operations: [CompositeRegionOperation])
Parameters
operations
The operations to be performed on the offline map.
-
Requests the cancellation of all operations scheduled with
schedule(operations:)
for the specifiedCompositeRegion
s.Declaration
Swift
public func cancelAllMapOperations(regionIDs: [CompositeRegionID])
Parameters
regionIDs
The list of
CompositeRegionID
s that were previously passed toschedule(operations:)
to schedule an operation. -
Finds the lowest-level of the parent
CompositeRegion
s that contains the givenRegionGraphNodeID
For the following region graph as an example,
findCompositeRegions(regionGraphNodeID: 3)
will returnSubRegion_0
andCountry_1
. Because thoseCompositeRegion
s are the lowest non-leaf regions with theRegionGraphNode
withRegionGraphNodeID
3.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 | |— CommonLeafRegion_0: 3 | |— SubRegion_1: 4 | |— LeafRegion_2: 4 |— Country_1: 3, 5, 6, 7 | |— LeafRegion_3: 5 | |— LeafRegion_4: 6 | |— LeafRegion_5: 7 | |— CommonLeafRegion_0: 3
Declaration
Swift
public func findCompositeRegions(regionGraphNodeID: RegionGraphNodeID) -> Set<CompositeRegion>
Parameters
regionGraphNodeID
The region graph node ID that can be from
findRegionsAroundPosition(position:radius:callback:)