updatePolygons method

  1. @override
Future<void> updatePolygons(
  1. PolygonUpdates polygonUpdates, {
  2. required int mapId,
})

Updates polygon configuration.

Change listeners are notified once the update has been made on the platform side.

The returned Future completes after listeners have been notified.

Implementation

@override
Future<void> updatePolygons(
  PolygonUpdates polygonUpdates, {
  required int mapId,
}) {
  return _hostApi(mapId).updatePolygons(
    polygonUpdates.polygonsToAdd.map(_platformPolygonFromPolygon).toList(),
    polygonUpdates.polygonsToChange.map(_platformPolygonFromPolygon).toList(),
    polygonUpdates.polygonIdsToRemove
        .map((PolygonId id) => id.value)
        .toList(),
  );
}