updateGroundOverlays method

  1. @override
Future<void> updateGroundOverlays(
  1. GroundOverlayUpdates groundOverlayUpdates, {
  2. required int mapId,
})

Updates ground overlay configuration.

The returned Future completes once the update has been made on the platform side.

Implementation

@override
Future<void> updateGroundOverlays(
  GroundOverlayUpdates groundOverlayUpdates, {
  required int mapId,
}) {
  assert(
    groundOverlayUpdates.groundOverlaysToAdd.every(
      (GroundOverlay groundOverlay) =>
          groundOverlay.position == null || groundOverlay.zoomLevel != null,
    ),
    'On iOS zoom level must be set when position is set for ground overlays.',
  );

  return _hostApi(mapId).updateGroundOverlays(
    groundOverlayUpdates.groundOverlaysToAdd
        .map(_platformGroundOverlayFromGroundOverlay)
        .toList(),
    groundOverlayUpdates.groundOverlaysToChange
        .map(_platformGroundOverlayFromGroundOverlay)
        .toList(),
    groundOverlayUpdates.groundOverlayIdsToRemove
        .map((GroundOverlayId id) => id.value)
        .toList(),
  );
}