Select to view content in your preferred language

Is resultRecordCount and resultOffset supported in FeatureLayer version of queryFeatures()?

347
1
Jump to solution
11-01-2024 03:35 PM
DavidMenninger
New Contributor

I'm wondering if resultRecordCount and resultOffset are supported parameters for the FeatureLayer class version of the queryFeatures() method?

 

// Initial FeatureLayer definition
myLayer = new FeatureLayer({
   portalItem: { id: "abcitseasyas123abcjustyouandme" },
   outFields: ["*"],
   renderer: polyColorDemoRenderer,
});

var query = {
   where: "1=1", 
   returnGeometry: true,
   returnCentroid: true,
   outFields: ["*"],
   resultRecordCount: 500,
   resultOffset: 1000,
   orderByFields: ["OBJECTID DESC"]
};

myLayer.queryFeatures(query).then(function(results) {
    console.log("results.features.length="+results.features.length);
});

 

When I run the Javascript above, it seems to always return the maximum number of results (2000) and ignore the resultOffset, so I'm calling they incorrectly or they aren't implemented for the FeatureLayer class' version of queryFeatures()?

 

0 Kudos
1 Solution

Accepted Solutions
JoelBennett
MVP Regular Contributor

The Query object doesn't have resultRecordCount and resultOffset properties, so those would be ignored.  Instead, you should use num and start, respectively.

View solution in original post

0 Kudos
1 Reply
JoelBennett
MVP Regular Contributor

The Query object doesn't have resultRecordCount and resultOffset properties, so those would be ignored.  Instead, you should use num and start, respectively.

0 Kudos