Skip to content
import PlacesQueryParameters from "@arcgis/core/rest/support/PlacesQueryParameters.js";
Inheritance:
PlacesQueryParametersPlacesParametersAccessor
Since
ArcGIS Maps SDK for JavaScript 4.27

The following properties define the parameters for the queryPlacesNearPoint() and queryPlacesWithinExtent() methods pointing to a url that represents a places service. The places service is a ready-to-use service that can search for businesses and geographic locations around the world. It allows you to discover, locate, and return detailed information about a place.

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

apiKey

inherited Property
Type
string | null | undefined
Inherited from: PlacesParameters

An authorization string used to access a resource or service. API keys are generated and managed in the portal. An API key is tied explicitly to an ArcGIS account; it is also used to monitor service usage. Setting a fine-grained API key on a specific class overrides the global API key.

See also

categoryIds

Property
Type
string[] | null | undefined

Filters places to those that match the category Ids. Places will be returned if they match any of the category Ids. If this property is not set, places will be returned regardless of their category.

You can search up to a maximum of 10 category Ids.

See also

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

extent

autocast Property
Type
Extent | null | undefined

The extent of the bounding box to be searched inside. This is required for the queryPlacesWithinExtent() method.

The total width of the extent must be less than 20,000 meters, and the total height of the extent must be less than 20,000 meters.

See also
Example
const [places, PlacesQueryParameters, Extent] = await $arcgis.import([
"@arcgis/core/rest/places.js",
"@arcgis/core/rest/support/PlacesQueryParameters.js",
"@arcgis/core/geometry/Extent.js"
);
const extent = new Extent({
xmin: 17.75,
ymin: 59.55,
xmax: 18,
ymax: 59.7,
spatialReference: SpatialReference.WGS84
});
const swedishPlacesQueryParameters = new PlacesQueryParameters({
apiKey: "YOUR_API_KEY",
categoryIds: ["4d4b7105d754a06377d81259"], // Landmarks and Outdoors
extent,
offset: 2,
searchText: "Värma"
});
function findPlaces() {
places.queryPlacesWithinExtent(swedishPlacesQueryParameters).then(showPlaces);
}
function showPlaces(placesSolveResult) {
// results from the queryPlacesWithinExtent() method
console.log("PlacesQueryResult: ", placesSolveResult);
// first PlaceResult object from PlacesQueryResult.results
console.log("PlaceResult: ", placesSolveResult.results[0]);
}
findPlaces();

icon

inherited Property
Type
"cim" | "png" | "svg" | null | undefined
Inherited from: PlacesParameters
Since
ArcGIS Maps SDK for JavaScript 4.30

Determines whether icons are returned and the type of icons returned. The PNG icons are provided as 48 x 48 pixels but for map display the recommended size is 16 x 16 pixels. Icons are not returned if the value is null.

offset

Property
Type
number

Request results starting from the given offset.

This parameter works with the pageSize property to get results from subsequent pages. For example, with pageSize = 2, setting the offset to 2 would return the 3rd and 4th results. Regardless of paging, the maximum number of places that can be returned by a single query is 200.

Default value
0

pageSize

Property
Type
number

The number of places that should be sent in the response for a single request.

You can set this to any value up to 20 when you need to control the size of responses that the app downloads. If the query results in more than this page size, then the response object will contain a next url fragment. This fragment can be used to form a request url to fetch the next page of results. The maximum number of places that can be returned in total is 200.

Default value
10

point

autocast Property
Type
Point | null | undefined

A location defined by X and Y coordinates. This is required for the queryPlacesNearPoint() method.

See also
Example
const [places, PlacesQueryParameters] = await $arcgis.import([
"@arcgis/core/rest/places.js",
"@arcgis/core/rest/support/PlacesQueryParameters.js"
]);
const point = {
type: "point", // autocasts as new Point()
longitude: 17.81840,
latitude: 59.42145
};
const swedishPlacesQueryParameters = new PlacesQueryParameters({
apiKey: "YOUR_API_KEY",
categoryIds: ["63be6904847c3692a84b9b4c"], // Bathroom Contractor
radius: 10000, // set radius to 10,000 meters
point,
searchText: "Bygg",
pageSize: 11
});
function findPlaces() {
places.queryPlacesNearPoint(swedishPlacesQueryParameters).then(showPlaces);
}
function showPlaces(placesSolveResult) {
// results from the queryPlacesNearPoint() method
console.log("PlacesQueryResult: ", placesSolveResult);
// first PlaceResult object from PlacesQueryResult.results
console.log("PlaceResult: ", placesSolveResult.results[0]);
}
findPlaces();

radius

Property
Type
number

The radius in meters to search for places, measured from the supplied point. This property is only used by the queryPlacesNearPoint() method. The maximum value is 10,000.

Default value
1000

searchText

Property
Type
string | null | undefined

Free search text for places against names, categories, etc. The value must be a string between 3 and 255 characters long.

url

inherited Property
Type
string
Inherited from: PlacesParameters

URL to the places service. The places service is a ready-to-use service that can search for businesses and geographic locations around the world. It allows you to discover, locate, and return detailed information about a place.

Default value
"https://places-api.arcgis.com/arcgis/rest/services/places-service/v1"

Methods

MethodSignatureClass
clone(): PlacesQueryParameters

clone

Method
Signature
clone (): PlacesQueryParameters

Creates a deep clone of the instance of PlacesQueryParameters that this method is called on.

Returns
PlacesQueryParameters

A clone of the instance that this method is called on.