copyWith method

PowerGeoJSONFeatureCollection copyWith({
  1. List<PowerGeoPoint>? geoJSONPoints,
  2. List<PowerGeoLineString>? geoJSONLineStrings,
  3. List<PowerGeoPolygon>? geoJSONPolygons,
})

Creates a copy of the PowerGeoJSONFeatureCollection with optional updates to its properties.

  • geoJSONPoints: Optional updated list of PowerGeoPoint instances.
  • geoJSONLineStrings: Optional updated list of PowerGeoLineString instances.
  • geoJSONPolygons: Optional updated list of PowerGeoPolygon instances.

Returns a new PowerGeoJSONFeatureCollection instance.

Implementation

PowerGeoJSONFeatureCollection copyWith({
  List<PowerGeoPoint>? geoJSONPoints,
  List<PowerGeoLineString>? geoJSONLineStrings,
  List<PowerGeoPolygon>? geoJSONPolygons,
}) {
  return PowerGeoJSONFeatureCollection(
    geoJSONPoints: geoJSONPoints ?? this.geoJSONPoints,
    geoJSONLineStrings: geoJSONLineStrings ?? this.geoJSONLineStrings,
    geoJSONPolygons: geoJSONPolygons ?? this.geoJSONPolygons,
  );
}