copyWithPreservingOtherMembers<T extends GeometryObject> method

Feature<T> copyWithPreservingOtherMembers<T extends GeometryObject>({
  1. T? geometry,
  2. Map<String, dynamic>? properties,
  3. BBox? bbox,
  4. dynamic id,
})

Create a new Feature with modified properties while preserving other members

Implementation

Feature<T> copyWithPreservingOtherMembers<T extends GeometryObject>({
  T? geometry,
  Map<String, dynamic>? properties,
  BBox? bbox,
  dynamic id,
}) {
  final newFeature = Feature<T>(
    geometry: geometry ?? this.geometry as T,
    properties: properties ?? this.properties,
    bbox: bbox ?? this.bbox,
    id: id ?? this.id,
  );

  newFeature.setOtherMembers(otherMembers);
  return newFeature;
}