memory<T extends Object> static method
- Uint8List bytes, {
- PolylineProperties<
T> ? polylineProperties, - Polyline<
T> builder()?, - MapController? mapController,
- Key? key,
Loads and displays polylines from a local file on a map.
The PowerGeoJSONPolylines.file method reads polyline data from a local file specified by
the path parameter and displays it on a map. You can customize the rendering
of the polylines using polylineProperties and builder.
Example usage:
PowerGeoJSONPolylines.file(
'/path/to/local/polyline_data.json',
polylineProperties: PolylineProperties(
color: Colors.blue,
width: 3.0,
),
mapController: myMapController,
);
The polylineCulling parameter allows you to enable or disable culling of
polylines that are outside the map's viewport, improving performance.
Returns a widget displaying the loaded polylines on the map.
Implementation
static Widget memory<T extends Object>(
Uint8List bytes, {
PolylineProperties<T>? polylineProperties,
Polyline<T> Function(List<LatLng> points, Map<String, Object?>? map)?
builder,
MapController? mapController,
Key? key,
}) {
return EnhancedFutureBuilder<Widget>(
future: _memoryPolylines(
bytes,
polylineProperties: polylineProperties ?? PolylineProperties<T>(),
builder: builder,
mapController: mapController,
key: key,
),
rememberFutureResult: true,
whenDone: (Widget snapshotData) => snapshotData,
whenNotDone: const Center(child: CupertinoActivityIndicator()),
);
}