featureCollection method

  1. @override
void featureCollection(
  1. WriteFeatures features, {
  2. int? count,
  3. Box? bounds,
  4. Map<String, dynamic>? custom,
})
override

Writes a feature collection with an array of features.

An optional expected count, when given, specifies the number of features in a collection. Note that when given the count MUST be exact.

An optional bounds can used set a minimum bounding box for a geometry written. A writer implementation may use it or ignore it.

Use custom to write any custom or "foreign member" properties.

An example:

  content.featureCollection(
      count: 2,
      (features) => features
          ..feature(
              id: '1',
              geometry: (geom) => geom.point([10.123, 20.25].xy),
              properties: {
                 'foo': 100,
                 'bar': 'this is property value',
                 'baz': true,
              },
          )
          ..feature(
              id: '2',
              // ...
          ),
  );

Implementation

@override
void featureCollection(
  WriteFeatures features, {
  int? count,
  Box? bounds,
  Map<String, dynamic>? custom,
}) {
  _add(
    FeatureCollection.build<E>(
      features,
      count: count,
      bounds: bounds,
      custom: custom,
    ),
  );
}