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) -> Bool

    Parameters

    lineAccessor

    the 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

    line

    Line to add.

  • Adds new lines to the data source.

    Declaration

    Swift

    public func add(_ lines: [LineData])

    Parameters

    lines

    Lines 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

    processor

    Line 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 true get removed from the data source. The inspector cannot update the line data.

    Declaration

    Swift

    public func removeIf(_ inspector: @escaping LineDataSource.LineDataProcessor)

    Parameters

    inspector

    Line data processor.