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 effectiveOptions = CircleOptions.defaultOptions.copyWith(options);
  final circle = Circle(getRandomString(), effectiveOptions, data);
  await circleManager!.add(circle);
  notifyListeners();
  return circle;
}