network<T extends Object> static method
Loads and displays polylines from a network URL on a map.
The PowerGeoJSONPolylines.network method fetches polyline data from a network URL specified by
the url parameter and displays it on a map. You can customize the rendering
of the polylines using polylineProperties and builder.
Example usage:
PowerGeoJSONPolylines.network(
'https://example.com/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 network<T extends Object>(
String url, {
Client? client,
List<int> statusCodes = const <int>[200],
Map<String, String>? headers,
// layer
Key? key,
PolylineProperties<T>? polylineProperties,
Widget Function(int? statusCode)? fallback,
Polyline<T> Function(List<LatLng> points, Map<String, Object?>? map)?
builder,
MapController? mapController,
}) {
Uri uriString = url.toUri();
return EnhancedFutureBuilder<Widget>(
future: _networkPolylines(
uriString,
headers: headers,
client: client,
statusCodes: statusCodes,
polylineProperties: polylineProperties ?? PolylineProperties<T>(),
builder: builder,
fallback: fallback,
mapController: mapController,
key: key,
),
rememberFutureResult: true,
whenDone: (Widget snapshotData) => snapshotData,
whenNotDone: const Center(child: CupertinoActivityIndicator()),
);
}