Esri / arcgis-rest-js

compact, modular JavaScript wrappers for the ArcGIS REST API
https://developers.arcgis.com/arcgis-rest-js/
Apache License 2.0
347 stars 119 forks source link

Automatic Pagination #690

Open gavinr opened 4 years ago

gavinr commented 4 years ago

Many of the ArcGIS REST API endpoints have "max items returned" limits. For example, if my group has 250 items in it, a call to https://www.arcgis.com/sharing/rest/content/groups/${groupId}/search will only return the first 100 items.

As of right now, a user of arcgis-rest-js has to handle paging through the items in this case.

I would request that we add an option to "Automatically paginate" through and get all the items (see similar concept in the GitHub REST API JavaScript library)

I realize this is a complex feature, so I am interested to know if the maintainers think this feature should be included in this project or not, and if so, discussion on how it might be achieved and implemented.

Thanks!

jgravois commented 4 years ago

ahh. the holy grail. https://github.com/Esri/geoservices-js/issues/35

just my two cents, but i think this would be popular enough to warrant including in the existing packages. that said, it might make it easier to test out the idea in a new package first.

gavinr commented 2 years ago

I've created a package that has this functionality: https://github.com/gavinr/query-all-features#query-all-features. I'm looking for others to use it and provide feedback. Thanks!