call method

Object? call([
  1. Map? object
])

Renders the given object, which may be any GeoJSON feature or geometry object:

  • Point - a single position.
  • MultiPoint - an array of positions.
  • LineString - an array of positions forming a continuous line.
  • MultiLineString - an array of arrays of positions forming several lines.
  • Polygon - an array of arrays of positions forming a polygon (possibly with holes).
  • MultiPolygon - a multidimensional array of positions forming multiple polygons.
  • GeometryCollection - an array of geometry objects.
  • Feature - a feature containing one of the above geometry objects.
  • FeatureCollection - an array of feature objects.

The type Sphere is also supported, which is useful for rendering the outline of the globe; a sphere has no coordinates.

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 GeoPathContext) is typically faster than SVG, but requires more effort to implement styling and interaction.

Implementation

Object? call([Map? object]) {
  _sink.pointRadius(pointRadius(object));
  _transformStream(_sink)(object);
  return _sink.result();
}