queryFeaturesWithFieldOptions method

Future<FeatureQueryResult> queryFeaturesWithFieldOptions(
  1. {required QueryParameters parameters,
  2. required QueryFeatureFields queryFeatureFields}
)

Queries features from this table's cache and/or from the feature service used to create this table.

If the request mode of the table is FeatureRequestMode.manualCache, then the query is always performed on the local table.

If the mode is FeatureRequestMode.onInteractionCache, then the query is performed on the local cache, provided that the geometries of the features are within an extent that has been cached; otherwise, the query is performed on the server.

If the mode is FeatureRequestMode.onInteractionNoCache, the query is always performed on the server.

QueryFeatureFields controls which fields will be included with the returned features. The options are:

  • If the service feature table FeatureRequestMode is onInteractionCache or onInteractionNoCache, the table will initially contains features with a minimum set of attribute required for rendering. To access all the feature's attributes you must load the features QueryFeatureFields.loadAll automatically loads the returned features into the local table and makes all attributes available.

  • If the service feature table FeatureRequestMode is manualCache, the table will contain the fields that you specified when calling ServiceFeatureTable.populateFromService

Note that you can query any attribute defined by the feature service's table. If the attribute is not in the set of attributes in your local table, the query will be performed on the server.

Parameters:

  • parameters — Options for controlling the operation.
  • queryFeatureFields — Options for controlling what fields are in the features of the query result.

Return Value: A Future that returns a FeatureQueryResult type.

Implementation

Future<FeatureQueryResult> queryFeaturesWithFieldOptions(
    {required QueryParameters parameters,
    required QueryFeatureFields queryFeatureFields}) {
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_ServiceFeatureTable_queryFeaturesWithFieldOptions(
        _handle,
        parameters._handle,
        queryFeatureFields.coreValue,
        errorHandler);
  });
  return taskHandle
      .toFuture((element) => element.getValueAsFeatureQueryResult()!);
}