asset<T extends Object> static method
Loads and displays polygons from an asset file on a map.
The url parameter specifies the asset file path to the polygon data.
Example:
PowerGeoJSONPolygons.asset(
'assets/polygon_data.geojson',
polygonProperties: PolygonProperties(
fillColor: Colors.blue,
strokeColor: Colors.red,
),
)
Implementation
static Widget asset<T extends Object>(
String url, {
// 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 EnhancedFutureBuilder<Widget>(
future: _assetPolygons(
url,
builder: builder,
polygonProperties: polygonProperties,
key: key,
polygonCulling: polygonCulling,
mapController: mapController,
),
rememberFutureResult: true,
whenDone: (Widget snapshotData) => snapshotData,
whenNotDone: const Center(child: CupertinoActivityIndicator()),
);
}