GroundOverlayUpdates.update constructor
GroundOverlayUpdates.update(
- Set<
GroundOverlay> previous, - Set<
GroundOverlay> current
Implementation
GroundOverlayUpdates.update(
Set<GroundOverlay> previous, Set<GroundOverlay> current) {
final Map<GroundOverlayId, GroundOverlay> oldGroundOverlays =
groundOverlayToMap(previous);
final Map<GroundOverlayId, GroundOverlay> currGroundOverlays =
groundOverlayToMap(current);
final Set<GroundOverlayId> oldIds = oldGroundOverlays.keys.toSet();
final Set<GroundOverlayId> currIds = currGroundOverlays.keys.toSet();
final Set<GroundOverlayId> _toDelete = oldIds.difference(currIds);
final Set<GroundOverlay> _toInsert = Set<GroundOverlay>.from(
currIds.difference(oldIds).map((id) => currGroundOverlays[id]).toSet());
final Set<GroundOverlay> _toUpdate = Set<GroundOverlay>.from(currIds
.intersection(oldIds)
.map((id) => currGroundOverlays[id])
.where((x) => isChanged(x!, oldGroundOverlays))
.toSet());
insertSet = _toInsert;
deleteSet = _toDelete;
updateSet = _toUpdate;
}