loadOrRefreshFeatures method

Future<void> loadOrRefreshFeatures(
  1. {required List<Feature> features}
)

Loads all attributes and geometries for features that have not been loaded and fetches attributes and geometries for previously loaded features.

Features returned from ServiceFeatureTable.queryFeaturesWithFieldOptions or ServiceFeatureTable.queryRelatedFeaturesWithFieldOptions may be in the minimally loaded state (minimum attributes required for rendering and no m-values). To load all attributes, pass a mutable array of the features to this method.

Any feature requested, but not returned, by the server will have its object id cleared (set to an invalid negative value) to indicate it is no longer associated with the service feature table.

After calling this method, any non-applied edits on the table will be lost.

This method will not refresh feature attachments. Use ArcGISFeature.fetchAttachments to retrieve attachments.

All features loaded or refreshed by this method will have m-values if defined by the service. Note that an m-value may be NaN.

Parameters:

  • features — The features to be loaded or refreshed.

Return Value: A Future that has no return value.

Implementation

Future<void> loadOrRefreshFeatures({required List<Feature> features}) {
  final coreFeatures =
      features.toMutableArray(valueType: _ElementType.feature);
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_ServiceFeatureTable_loadOrRefreshFeatures(
        _handle, coreFeatures._handle, errorHandler);
  });
  return taskHandle.toFuture((_) {});
}