string<T extends Object> static method

PolygonLayer<T> string<T extends Object>(
  1. String data, {
  2. Key? key,
  3. bool polygonCulling = false,
  4. Polygon<T> builder(
    1. List<List<LatLng>> coordinates,
    2. Map<String, dynamic>? map
    )?,
  5. PolygonProperties<T>? polygonProperties,
  6. MapController? mapController,
})

Loads and displays polygons from a string in GeoJSON format on a map.

The data parameter contains the polygon data in GeoJSON format.

Example:

PowerGeoJSONPolygons.string(
  '{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[...]]}}',
  mapController: myMapController,
)

Implementation

static PolygonLayer<T> string<T extends Object>(
  String data, {
  // layer
  Key? key,
  bool polygonCulling = false,
  Polygon<T> Function(
    List<List<LatLng>> coordinates,
    Map<String, dynamic>? map,
  )?
  builder,
  PolygonProperties<T>? polygonProperties,
  MapController? mapController,
}) {
  assert(
    (builder == null && polygonProperties != null) ||
        (polygonProperties == null && builder != null),
  );
  return _string(
    data,
    builder: builder,
    polygonProperties: polygonProperties,
    key: key,
    polygonCulling: polygonCulling,
    mapController: mapController,
  );
}