memory<T extends Object> static method

Widget memory<T extends Object>(
  1. Uint8List bytes, {
  2. required FeatureCollectionProperties<T> featureCollectionLayerProperties,
  3. MapController? mapController,
  4. Key? key,
  5. bool polygonCulling = false,
  6. required Widget builder(
    1. FeatureCollectionProperties<T> featureCollectionProperties,
    2. Map<String, dynamic>? map
    ),
  7. PowerMarkerClusterOptions? powerClusterOptions,
})

Loads and displays GeoJSON feature collections from memory as a Widget.

  • bytes: The GeoJSON data as a Uint8List.
  • featureCollectionProperties: Properties to customize the appearance of the feature collections.
  • mapController: An optional MapController for controlling the map view.
  • key: An optional Key for identifying the returned Widget.
  • polylineCulling: A boolean indicating whether polyline culling is enabled (default is false).
  • polygonCulling: A boolean indicating whether polygon culling is enabled (default is false).
  • builder: A function that takes the featureCollectionProperties and a map of feature properties and returns a Widget to render the features.

Returns a Widget displaying the GeoJSON feature collections from memory.

Implementation

static Widget memory<T extends Object>(
  Uint8List bytes, {
  required FeatureCollectionProperties<T> featureCollectionLayerProperties,
  MapController? mapController,
  Key? key,
  bool polygonCulling = false,
  required Widget Function(
    FeatureCollectionProperties<T> featureCollectionProperties,
    Map<String, dynamic>? map,
  )
  builder,
  PowerMarkerClusterOptions? powerClusterOptions,
}) {
  return EnhancedFutureBuilder<Widget>(
    future: _memoryFeatureCollections(
      bytes,
      powerClusterOptions: powerClusterOptions,
      featureCollectionLayerProperties: featureCollectionLayerProperties,
      mapController: mapController,
      polygonCulling: polygonCulling,
      builder: builder,
      key: key,
    ),
    rememberFutureResult: true,
    whenDone: (Widget child) => child,
    whenNotDone: const Center(child: CupertinoActivityIndicator()),
  );
}