TableQuerySublayerSource constructor

TableQuerySublayerSource({
  1. required String workspaceId,
  2. required String sqlQuery,
  3. required List<String> objectIdFieldNames,
})

Creates a table query sublayer source.

Parameters:

  • workspaceId — The workspace ID.
  • sqlQuery — The SQL query.
  • objectIdFieldNames — The object ID field names as a List of String.

Implementation

factory TableQuerySublayerSource({
  required String workspaceId,
  required String sqlQuery,
  required List<String> objectIdFieldNames,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreWorkspaceId = _CString(workspaceId);
  final coreSqlQuery = _CString(sqlQuery);
  final coreObjectIdFieldNames = objectIdFieldNames.toArray(
    valueType: _ElementType.string,
  );
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore
        .RT_TableQuerySublayerSource_createWithIdQueryAndObjectIdFieldNames(
      coreWorkspaceId.bytes,
      coreSqlQuery.bytes,
      coreObjectIdFieldNames._handle,
      errorHandler,
    );
  });
  final TableQuerySublayerSource object =
      TableQuerySublayerSource._withHandle(handle);
  object._objectIdFieldNames.value.setCache(objectIdFieldNames);
  return object;
}