findPlacesWithinExtent

findPlacesWithinExtent

Function
findPlacesWithinExtent(requestOptionsIFindPlaceWithinExtentOptions): Promise<IFindPlacesWithinExtentResponse>

Searches the world-wide set of places for those that are within an extent, or bounding box. You must supply the xmin, ymin, xmax andymax coordinates of the extent. You could use this endpoint to search for places in the visible extent of a user's screen.

The returned places contain basic data such as name, category and location. You can use the getPlace method to get additional details for a given place.

You can also refine the results by supplying additional search parameters, including:

As this request can return many results, pagination is supported. When a query results in more than [pageSize] places, the response will contain the propertypagination in addition to place results. If pagination exists, an additional methodresponse.nextPage() can be used to get the next page of results.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
import { findPlacesWithinExtent } from "@esri/arcgis-rest-places";
import { ApiKeyManager } from "@esri/arcgis-rest-request";

const results = await findPlacesWithinExtent({
  xmin: -118.013334,
  ymin: 33.78193,
  xmax: -117.795753,
  ymax: 33.873337,
  categoryIds: ["13002"],
  authentication: ApiKeyManager.fromKey("YOUR_API_KEY")
});

console.log(results)
Parameters
ParameterType
requestOptions
IFindPlaceWithinExtentOptions
Returns 
Promise<IFindPlacesWithinExtentResponse>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.