Portal.queryItems(queryParams?)
can be used to query the portal for items. However, there doesn't appear to be a a way to query for items within a specific search geometry (such as within a map extent). The PortalItems that are returned can be examined to determine if their extents intersect the search geometry (requiring an additional call to the GeometryService).
This seems like something that should be possible, as evidenced by the fact that you can do it from within the ArcGIS Online map viewer. Is it possible?
Solved! Go to Solution.
Hey Jonathan,
Are you using 3.x? If so you should be able to specify bbox property in queryParams. I have not tested it but it should work. Here a link to REST API doc for search: ArcGIS REST API
if you are using 4.x then you can specify PortalQueryParams.extent: PortalQueryParams | API Reference | ArcGIS API for JavaScript 4.2
Hope this helps
Hey Jonathan,
Are you using 3.x? If so you should be able to specify bbox property in queryParams. I have not tested it but it should work. Here a link to REST API doc for search: ArcGIS REST API
if you are using 4.x then you can specify PortalQueryParams.extent: PortalQueryParams | API Reference | ArcGIS API for JavaScript 4.2
Hope this helps
Hi Undral,
I'm using the 3.19 version of the JavaScript API. I was looking at the documentation here:
Portal | API Reference | ArcGIS API for JavaScript 3.19
This documentation doesn't indicate any reference to the bbox parameter. But, as you suggested, I tried adding a bbox parameter to my query parameters, and it worked! Strange that this isn't included in the JavaScript API documentation.
Thanks!