addLines method

Future<List<Line>> addLines(
  1. List<LineOptions> options, [
  2. List<Map>? data
])

Adds multiple lines to the map, configured using the specified custom options.

Change listeners are notified once the lines have been added on the platform side.

The returned Future completes with the added line once listeners have been notified.

Implementation

Future<List<Line>> addLines(List<LineOptions> options,
    [List<Map>? data]) async {
  final lines = await _mapboxGlPlatform.addLines(options, data);
  lines.forEach((l) => _lines[l.id] = l);
  notifyListeners();
  return lines;
}