addGeoJsonAsMarkerCollection method
Imports a GeoJSON data buffer as a MarkerCollection list.
Does not add the markers to the map, only imports the GeoJSON to a MarkerCollection list. The returned marker collections can then be customized and added to the map via the MapViewMarkerCollections.add method via the MapViewPreferences.markers provided by preferences.
Parameters
bufferThe GeoJSON data buffer to be added as a marker collection.nameThe name of the marker collection.
Returns
- The created marker collections
Implementation
List<MarkerCollection> addGeoJsonAsMarkerCollection(
final String buffer,
final String name,
) {
final OperationResult resultString = objectMethod(
_pointerId,
'MapView',
'addGeoJsonAsMarkerCollection',
args: <String, String>{'name': name, 'databuffer': buffer},
);
final List<MarkerCollection> pRet = List<MarkerCollection>.empty(
growable: true,
);
for (final int markerCollectionId in resultString['result']) {
pRet.add(MarkerCollection.init(markerCollectionId, 0));
}
return pRet;
}