@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
57 lines (55 loc) • 2.95 kB
TypeScript
import type PlacesParameters from "./PlacesParameters.js";
import type { PlacesParametersProperties } from "./PlacesParameters.js";
export interface FetchPlaceParametersProperties extends PlacesParametersProperties, Partial<Pick<FetchPlaceParameters, "placeId" | "requestedFields">> {}
/**
* The following properties define the parameters for the
* [fetchPlace()](https://developers.arcgis.com/javascript/latest/references/core/rest/places/#fetchPlace) method pointing to a
* [url](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FetchPlaceParameters/#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.
*
* @since 4.27
* @see [Sample - Find nearby places and details](https://developers.arcgis.com/javascript/latest/sample-code/places/)
* @see [Introduction to places](https://developers.arcgis.com/documentation/mapping-apis-and-services/places/)
* @see [Places category finder](https://developers.arcgis.com/documentation/mapping-apis-and-services/places/places-category-finder/)
* @see [Places service](https://developers.arcgis.com/rest/places/)
* @see [places](https://developers.arcgis.com/javascript/latest/references/core/rest/places/)
* @see [PlacesParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/PlacesParameters/)
* @see [PlacesQueryParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/PlacesQueryParameters/)
* @example
* const [places, FetchPlaceParameters] = await $arcgis.import([
* "@arcgis/core/rest/places.js",
* "@arcgis/core/rest/support/FetchPlaceParameters.js"
* ]);
* const swedishFetchPlaceParameters = new FetchPlaceParameters({
* apiKey: "YOUR_API_KEY",
* placeId: "571624acd79b8a99897357a25b744a20", // really good plumber
* requestedFields: ["address", "description", "hours", "socialMedia"]
* });
*
* function fetchPlaceDetails() {
* places.fetchPlace(swedishFetchPlaceParameters).then(showPlaceDetails);
* }
*
* function showPlaceDetails(fetchResult) {
* console.log("Fetch place result: ", fetchResult);
* }
*
* fetchPlaceDetails();
*/
export default class FetchPlaceParameters extends PlacesParameters {
constructor(properties?: FetchPlaceParametersProperties);
/**
* The Id of the place that you want to fetch additional details.
* This is **required**.
*/
accessor placeId: string | null | undefined;
/**
* The array of fields that define the attributes to return for a place.
* Use this property to define the attributes you would like returned.
* This is **required**.
*
* @see [Enumerated values](https://developers.arcgis.com/rest/places/place-id-get/#requestedfields)
*/
accessor requestedFields: string[] | null | undefined;
}