removeCircles method

Future<void> removeCircles(
  1. Iterable<Circle> circles
)

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

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

The returned Future completes once listeners have been notified.

Implementation

Future<void> removeCircles(Iterable<Circle> circles) async {
  final ids = circles.where((c) => _circles[c.id] == c).map((c) => c.id);
  assert(circles.length == ids.length);

  await _mapboxGlPlatform.removeCircles(ids);
  ids.forEach((id) => _circles.remove(id));
  notifyListeners();
}