call method
Renders the given object
, which may be any GeoJSON feature or geometry
object:
- Point - a single position.
- MultiPoint - an list of positions.
- LineString - an list of positions forming a continuous line.
- MultiLineString - an list of list of positions forming several lines.
- Polygon - an list of lists of positions forming a polygon (possibly with holes).
- MultiPolygon - a multidimensional list of positions forming multiple polygons.
- GeometryCollection - an list of geometry objects.
- Feature - a feature containing one of the above geometry objects.
- FeatureCollection - an list of feature objects.
The type Sphere is also supported, which is useful for rendering the outline of the globe; a sphere has no coordinates. Any additional arguments are passed along to the pointRadius accessor.
To display multiple features, combine them into a feature collection:
GeoPath()({"type": "FeatureCollection", "features": features});
Or use multiple path elements:
var path = GeoPath();
for (feature in features) {
path(feature);
}
Separate path elements are typically slower than a single path element. However, distinct path elements are useful for styling and interaction (e.g., click or mouseover). Canvas rendering (see context) is typically faster than SVG, but requires more effort to implement styling and interaction.
Implementation
String? call([Map? object, List? arguments]) {
_sink.pointRadius(pointRadius(object, arguments));
_transformStream(_sink)(object);
return _sink.result();
}