feature method
void
feature({
- Object? id,
- WriteGeometries? geometry,
- Map<
String, dynamic> ? properties, - Box? bounds,
- Map<
String, dynamic> ? custom,
override
Writes a feature with id
, geometry
and properties
.
The id
, when non-null, should be either a string or an integer number.
At least one geometry using geometry
should be written using methods
defined by GeometryContent. When there are more than one geometry, it's
recommended to use the name
argument when writing those other.
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 along with
those set by properties
.
An example:
content.feature(
id: '1',
geometry: (geom) => geom.point([10.123, 20.25].xy),
properties: {
'foo': 100,
'bar': 'this is property value',
'baz': true,
},
);
Implementation
@override
void feature({
Object? id,
WriteGeometries? geometry,
Map<String, dynamic>? properties,
Box? bounds,
Map<String, dynamic>? custom,
}) {
_add(
Feature<E>.build(
id: id,
geometry: geometry,
properties: properties,
bounds: bounds,
custom: custom,
),
);
}