addCircle method

Future<Circle> addCircle(
  1. CircleOptions options, [
  2. Map? data
])

Adds a circle to the map, configured using the specified custom options.

Change listeners are notified once the circle has been added on the platform side.

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

Implementation

Future<Circle> addCircle(CircleOptions options, [Map? data]) async {
  final CircleOptions effectiveOptions =
      CircleOptions.defaultOptions.copyWith(options);
  final circle = await _mapboxGlPlatform.addCircle(effectiveOptions, data);
  _circles[circle.id] = circle;
  notifyListeners();
  return circle;
}