Select to view content in your preferred language

limit the number of features in feature layer

382
2
08-11-2022 07:18 AM
GuyShaharabani
Emerging Contributor

I use the feature Layer definitionExpression property, and it is working.

But I want to limit the number of features the feature layer will load or display.

Is there a way to that in JS or it has to done it arcgis pro(before publishing the layer)?

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

The maxRecordCount property needs to be set at the time of feature service publishing: https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm

If you are using Query class to query features from your FeatureLayer then use the Query.num property to specify the number of features to retrieve: https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html#num

 

0 Kudos
GuyShaharabani
Emerging Contributor

but the property maxRecordCount determines the number of features returned from a query, I just want to limit to number of features displayed from the layer at all times.

am I worng?

0 Kudos