LineDataSource
public class LineDataSource
extension LineDataSource: NativeBase
extension LineDataSource: Hashable
Polyline data source allows the rendering engine access to the user provided polylines geometry and their attributes.
Polyline segments are rendered following the shortest path between their end vertices.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.
-
Called for each line, allowing inspection, removal or update of coordinates and attributes.
Declaration
Swift
public typealias LineDataProcessor = (_ lineAccessor: LineDataAccessor) -> BoolParameters
lineAccessorthe line data accessor.
Return Value
value indicating the result of the processing.
-
Adds a new line to the data source.
Declaration
Swift
public func add(_ line: LineData)Parameters
lineLine to add.
-
Adds new lines to the data source.
Declaration
Swift
public func add(_ lines: [LineData])Parameters
linesLines to add.
-
Removes all lines from the data source.
Declaration
Swift
public func removeAll() -
Iterates through all the lines from the data source and passes them to the given processor, one by one. The processor can update the line data. The iteration stops after all lines have been processed or the processor returns false from the process call.
Declaration
Swift
public func forEach(_ processor: @escaping LineDataSource.LineDataProcessor)Parameters
processorLine processor.
-
Iterates through all the lines from the data source and passes them to the given inspector, one by one. All lines for which the inspector returns
trueget removed from the data source. The inspector cannot update the line data.Declaration
Swift
public func removeIf(_ inspector: @escaping LineDataSource.LineDataProcessor)Parameters
inspectorLine data processor.