An object literal which contains the query-parameters. It is used to pass

interface WFSQueryOptions {
    filter?: OGCExpression;
    maxFeatures?: number;
    propertyNames?: string[];
    sortBy?: SortBy[];
}

Properties

filter?: OGCExpression

Contains the OGC expression that the server must apply on the requested feature types.

maxFeatures?: number

The maximum number of features the server should return in the response of this query.

propertyNames?: string[]

The properties of the feature to include in the response. When left undefined, all properties of the feature are returned.

sortBy?: SortBy[]

Sets the OGC SortBy conditions that the WFS should apply to the requested features.

The results returned by a WFS service can be organised in a particular order. This functionality is useful in situations where features have properties representing quantities, like a city population, and in combination with WFSQueryOptions.maxFeatures.

The following example demonstrates how to set a QueryProvider to retrieve a limited number of features sorted by the population property. The sortBy property ensures that you have the most densely populated cities. Without the sort order, the query will retrieve 100 undetermined cities.

  class MaxFeaturesQueryProvider extends QueryProvider {
getQueryForLevel(level: number): WFSQueryOptions {
return {
maxFeatures: 100,
sortBy: [{
sortProperty: "TOT_POP",
sortOrder: SortOrder.Descending
}]
};
}

getQueryLevelScales(layer: FeatureLayer, map: Map): number[] {
return [];
}
}

You can provide more than a single SortBy condition. The following example orders features, sorted by the "Country" and the "Name" property. This means that features are first ordered by "Country", and then if some features have the same "Country", they are ordered by "Name".

      sortBy: [
{sortProperty: "Country", sortOrder: SortOrder.Ascending},
{sortProperty: "Name", sortOrder: SortOrder.Descending},
]

Since

2022.0.6