memory<T extends Object> static method

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

Loads and displays polygons from memory data on a map.

The bytes parameter contains the polygon data as a Uint8List.

Example:

PowerGeoJSONPolygons.memory(
  myGeojsonData,
  polygonCulling: true,
)

Implementation

static Widget memory<T extends Object>(
  Uint8List bytes, {
  // layer
  Key? key,
  bool polygonCulling = false,
  PolygonProperties<T>? polygonProperties,
  Polygon<T> Function(
    List<List<LatLng>> coordinates,
    Map<String, dynamic>? map,
  )?
  builder,
  MapController? mapController,
}) {
  assert(
    (builder == null && polygonProperties != null) ||
        (polygonProperties == null && builder != null),
  );
  return EnhancedFutureBuilder<Widget>(
    future: _memoryPolygons(
      bytes,
      builder: builder,
      polygonProperties: polygonProperties,
      key: key,
      polygonCulling: polygonCulling,
      mapController: mapController,
    ),
    rememberFutureResult: true,
    whenDone: (Widget snapshotData) => snapshotData,
    whenNotDone: const Center(child: CupertinoActivityIndicator()),
  );
}