addList method
Future<List<int> >
addList({
- required List<
MarkerWithRenderSettings> list, - required MarkerCollectionRenderSettings settings,
- required String name,
- MarkerType markerType = MarkerType.point,
Add a large list of markers to the map efficiently.
Accepts a list of MarkerWithRenderSettings together with a
single MarkerCollectionRenderSettings and a collection name. It is
optimized for bulk insertion (useful when adding thousands of markers).
Parameters
list: A list of MarkerWithRenderSettings to add.settings: Global MarkerCollectionRenderSettings applied to the collection.name: Desired name for the created collection.markerType: Optional MarkerType for the created collection.
Returns
- A Future<List<int>> that completes with the ids of the added markers.
Implementation
Future<List<int>> addList({
required final List<MarkerWithRenderSettings> list,
required final MarkerCollectionRenderSettings settings,
required final String name,
final MarkerType markerType = MarkerType.point,
}) async {
final dynamic jsonResponse = await GemKitPlatform.instance.addList(
object: this,
list: list,
settings: settings,
name: name,
parentMapId: _mapPointerId,
markerType: markerType,
);
final Map<String, dynamic> parsedResponse = jsonDecode(jsonResponse);
final List<int> resultList = List<int>.from(parsedResponse['result']);
return resultList;
}