diff --git a/lib/src/controller.dart b/lib/src/controller.dart index 72c1c0bd9..8a0a55a22 100644 --- a/lib/src/controller.dart +++ b/lib/src/controller.dart @@ -648,6 +648,21 @@ class MapboxMapController extends ChangeNotifier { notifyListeners(); } + /// Removes all [fill] from the map. + /// + /// Change listeners are notified once all fills have been removed on the + /// platform side. + /// + /// The returned [Future] completes once listeners have been notified. + Future clearFills() async { + assert(_fills != null); + final List fillIds = List.from(_fills.keys); + for (String id in fillIds) { + await _removeFill(id); + } + notifyListeners(); + } + /// Removes the specified [fill] from the map. The fill must be a current /// member of the [fills] set. ///