copyWith method
Copy this feature with optional id
, geometry
, properties
and
custom
properties.
When a new geometry
is given, then the returned collection has bounds
set to null.
Implementation
Feature<T> copyWith({
Object? id,
T? geometry,
Map<String, dynamic>? properties,
Map<String, dynamic>? custom,
}) =>
Feature(
id: id ?? this.id,
geometry: geometry ?? this.geometry,
properties: properties ?? this.properties,
custom: custom ?? this.custom,
// bounds set to null if new geometry set
bounds: geometry != null ? null : bounds,
);