removeLines method

Future<void> removeLines(
  1. Iterable<Line> lines
)

Removes the specified lines from the map. The lines must be current members of the lines set.

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

The returned Future completes once listeners have been notified.

Implementation

Future<void> removeLines(Iterable<Line> lines) async {
  final ids = lines.where((l) => _lines[l.id] == l).map((l) => l.id);
  assert(lines.length == ids.length);

  await _mapboxGlPlatform.removeLines(ids);
  ids.forEach((id) => _lines.remove(id));
  notifyListeners();
}