copyWith method
Copy this feature collection with optional features
and custom
properties.
When a new list of features
is given, then the returned collection has
bounds set to null.
Implementation
FeatureCollection<E> copyWith({
List<E>? features,
Map<String, dynamic>? custom,
}) {
if (features != null) {
final type = resolveCoordTypeFrom(collection: features);
return FeatureCollection<E>._(
features,
type,
custom: custom ?? this.custom,
);
} else if (custom != null) {
return FeatureCollection<E>._(
this.features,
this.coordType,
custom: custom,
bounds: bounds,
);
} else {
// ignore: avoid_returning_this
return this;
}
}