@esri/arcgis-rest-places 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -0
- package/dist/bundled/places.esm.js +217 -0
- package/dist/bundled/places.esm.js.map +1 -0
- package/dist/bundled/places.esm.min.js +7 -0
- package/dist/bundled/places.esm.min.js.map +1 -0
- package/dist/bundled/places.umd.js +229 -0
- package/dist/bundled/places.umd.js.map +1 -0
- package/dist/bundled/places.umd.min.js +7 -0
- package/dist/bundled/places.umd.min.js.map +1 -0
- package/dist/cjs/findPlacesNearPoint.js +58 -0
- package/dist/cjs/findPlacesNearPoint.js.map +1 -0
- package/dist/cjs/findPlacesWithinExtent.js +68 -0
- package/dist/cjs/findPlacesWithinExtent.js.map +1 -0
- package/dist/cjs/getCategories.js +33 -0
- package/dist/cjs/getCategories.js.map +1 -0
- package/dist/cjs/getCategory.js +27 -0
- package/dist/cjs/getCategory.js.map +1 -0
- package/dist/cjs/getPlaceDetails.js +40 -0
- package/dist/cjs/getPlaceDetails.js.map +1 -0
- package/dist/cjs/index.js +11 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/openapi-types.js +7 -0
- package/dist/cjs/openapi-types.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/utils.js +17 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/esm/findPlacesNearPoint.d.ts +55 -0
- package/dist/esm/findPlacesNearPoint.js +54 -0
- package/dist/esm/findPlacesNearPoint.js.map +1 -0
- package/dist/esm/findPlacesWithinExtent.d.ts +56 -0
- package/dist/esm/findPlacesWithinExtent.js +64 -0
- package/dist/esm/findPlacesWithinExtent.js.map +1 -0
- package/dist/esm/getCategories.d.ts +38 -0
- package/dist/esm/getCategories.js +29 -0
- package/dist/esm/getCategories.js.map +1 -0
- package/dist/esm/getCategory.d.ts +32 -0
- package/dist/esm/getCategory.js +23 -0
- package/dist/esm/getCategory.js.map +1 -0
- package/dist/esm/getPlaceDetails.d.ts +45 -0
- package/dist/esm/getPlaceDetails.js +36 -0
- package/dist/esm/getPlaceDetails.js.map +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/openapi-types.d.ts +1499 -0
- package/dist/esm/openapi-types.js +6 -0
- package/dist/esm/openapi-types.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/utils.d.ts +6 -0
- package/dist/esm/utils.js +12 -0
- package/dist/esm/utils.js.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { operations } from "./openapi-types.js";
|
|
3
|
+
declare type queryParams = Pick<operations["nearPointGet"]["parameters"]["query"], "x" | "y" | "radius" | "categoryIds" | "pageSize" | "offset" | "searchText">;
|
|
4
|
+
declare type successResponse = operations["nearPointGet"]["responses"]["200"]["content"]["application/json"];
|
|
5
|
+
/**
|
|
6
|
+
* The response format for {@linkcode findPlacesNearPoint};
|
|
7
|
+
*/
|
|
8
|
+
export interface IFindPlacesNearPointResponse extends successResponse {
|
|
9
|
+
nextPage?: () => Promise<IFindPlacesNearPointResponse>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Options for {@linkcode findPlacesNearPoint}.
|
|
13
|
+
*/
|
|
14
|
+
export interface IFindPlacesNearPointOptions extends Omit<IRequestOptions, "httpMethod" | "f">, queryParams {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Searches places that are within a given radius of a geographic point.
|
|
18
|
+
* You must supply the `x` and `y` coordinates of the point that you wish
|
|
19
|
+
* to search from. You can either specify a search radius, or use the
|
|
20
|
+
* default (500 meters). You could use this method to search for places
|
|
21
|
+
* around a user's GPS position, or a location clicked on a map.
|
|
22
|
+
*
|
|
23
|
+
* The returned places contain basic data such as name, category and
|
|
24
|
+
* location. You can use the {@linkcode getPlace} method to get additional
|
|
25
|
+
* details for a given place.
|
|
26
|
+
*
|
|
27
|
+
* You can refine the results by supplying additional search parameters,
|
|
28
|
+
* including:
|
|
29
|
+
*
|
|
30
|
+
* - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.
|
|
31
|
+
* - A partial name filter with `name` option
|
|
32
|
+
*
|
|
33
|
+
* As this request can return many results, pagination is supported.
|
|
34
|
+
* Regardless of paging, the maximum number of places that can be returned
|
|
35
|
+
* by a single query is `200`. When a query results in more than `200`
|
|
36
|
+
* places, the response will contain the property
|
|
37
|
+
* `"maxResultsExceeded":true` in addition to place results. If `maxResultsExceeded`
|
|
38
|
+
* is true an additional method `response.nextPage()` can be used to get the next page of results.
|
|
39
|
+
*
|
|
40
|
+
* ```js
|
|
41
|
+
* import { findPlacesNearPoint } from "@esri/arcgis-rest-places";
|
|
42
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
43
|
+
*
|
|
44
|
+
* const response = await findPlacesNearPoint({
|
|
45
|
+
* x: -3.1883,
|
|
46
|
+
* y: 55.9533,
|
|
47
|
+
* radius: 100,
|
|
48
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY");
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* console.log(response);
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function findPlacesNearPoint(requestOptions: IFindPlacesNearPointOptions): Promise<IFindPlacesNearPointResponse>;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { request, appendCustomParams } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { baseUrl, hasNextPage, getNextPageParams } from "./utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* Searches places that are within a given radius of a geographic point.
|
|
5
|
+
* You must supply the `x` and `y` coordinates of the point that you wish
|
|
6
|
+
* to search from. You can either specify a search radius, or use the
|
|
7
|
+
* default (500 meters). You could use this method to search for places
|
|
8
|
+
* around a user's GPS position, or a location clicked on a map.
|
|
9
|
+
*
|
|
10
|
+
* The returned places contain basic data such as name, category and
|
|
11
|
+
* location. You can use the {@linkcode getPlace} method to get additional
|
|
12
|
+
* details for a given place.
|
|
13
|
+
*
|
|
14
|
+
* You can refine the results by supplying additional search parameters,
|
|
15
|
+
* including:
|
|
16
|
+
*
|
|
17
|
+
* - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.
|
|
18
|
+
* - A partial name filter with `name` option
|
|
19
|
+
*
|
|
20
|
+
* As this request can return many results, pagination is supported.
|
|
21
|
+
* Regardless of paging, the maximum number of places that can be returned
|
|
22
|
+
* by a single query is `200`. When a query results in more than `200`
|
|
23
|
+
* places, the response will contain the property
|
|
24
|
+
* `"maxResultsExceeded":true` in addition to place results. If `maxResultsExceeded`
|
|
25
|
+
* is true an additional method `response.nextPage()` can be used to get the next page of results.
|
|
26
|
+
*
|
|
27
|
+
* ```js
|
|
28
|
+
* import { findPlacesNearPoint } from "@esri/arcgis-rest-places";
|
|
29
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
30
|
+
*
|
|
31
|
+
* const response = await findPlacesNearPoint({
|
|
32
|
+
* x: -3.1883,
|
|
33
|
+
* y: 55.9533,
|
|
34
|
+
* radius: 100,
|
|
35
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY");
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* console.log(response);
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function findPlacesNearPoint(requestOptions) {
|
|
42
|
+
const options = appendCustomParams(requestOptions, ["x", "y", "radius", "categoryIds", "pageSize", "offset", "searchText"], Object.assign({}, requestOptions));
|
|
43
|
+
return request(`${baseUrl}/places/near-point`, Object.assign(Object.assign({}, options), { httpMethod: "GET" })).then((response) => {
|
|
44
|
+
const r = Object.assign({}, response);
|
|
45
|
+
if (hasNextPage(response)) {
|
|
46
|
+
r.nextPage = () => {
|
|
47
|
+
const nextOptions = Object.assign(Object.assign({}, requestOptions), getNextPageParams(requestOptions.offset, requestOptions.pageSize));
|
|
48
|
+
return findPlacesNearPoint(nextOptions);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return r;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=findPlacesNearPoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findPlacesNearPoint.js","sourceRoot":"","sources":["../../src/findPlacesNearPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA2BrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,UAAU,mBAAmB,CACjC,cAA2C;IAE3C,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,CAAC,oBAElE,cAAc,EAEpB,CAAC;IAEF,OACE,OAAO,CAAC,GAAG,OAAO,oBAAoB,kCACjC,OAAO,KACV,UAAU,EAAE,KAAK,IAEpB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QAClB,MAAM,CAAC,qBACF,QAAQ,CACZ,CAAC;QAEF,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE;YACzB,CAAC,CAAC,QAAQ,GAAG,GAAG,EAAE;gBAChB,MAAM,WAAW,mCACZ,cAAc,GACd,iBAAiB,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CACrE,CAAC;gBACF,OAAO,mBAAmB,CAAC,WAAW,CAAC,CAAC;YAC1C,CAAC,CAAC;SACH;QAED,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } from \"./utils.js\";\n\n// determine the list of allowed params we want to allow as options\n// this should match the array given to appendCustomParams below\ntype queryParams = Pick<\n operations[\"nearPointGet\"][\"parameters\"][\"query\"],\n \"x\" | \"y\" | \"radius\" | \"categoryIds\" | \"pageSize\" | \"offset\" | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"nearPointGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesNearPoint};\n */\nexport interface IFindPlacesNearPointResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesNearPointResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlacesNearPointOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {}\n\n/**\n * Searches places that are within a given radius of a geographic point.\n * You must supply the `x` and `y` coordinates of the point that you wish\n * to search from. You can either specify a search radius, or use the\n * default (500 meters). You could use this method to search for places\n * around a user's GPS position, or a location clicked on a map.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlace} method to get additional\n * details for a given place.\n *\n * You can refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * Regardless of paging, the maximum number of places that can be returned\n * by a single query is `200`. When a query results in more than `200`\n * places, the response will contain the property\n * `\"maxResultsExceeded\":true` in addition to place results. If `maxResultsExceeded`\n * is true an additional method `response.nextPage()` can be used to get the next page of results.\n *\n * ```js\n * import { findPlacesNearPoint } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await findPlacesNearPoint({\n * x: -3.1883,\n * y: 55.9533,\n * radius: 100,\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\");\n * });\n *\n * console.log(response);\n * ```\n */\nexport function findPlacesNearPoint(\n requestOptions: IFindPlacesNearPointOptions\n): Promise<IFindPlacesNearPointResponse> {\n const options = appendCustomParams<IFindPlacesNearPointOptions>(\n requestOptions,\n [\"x\", \"y\", \"radius\", \"categoryIds\", \"pageSize\", \"offset\", \"searchText\"],\n {\n ...requestOptions\n }\n );\n\n return (\n request(`${baseUrl}/places/near-point`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesNearPointResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesNearPoint(nextOptions);\n };\n }\n\n return r;\n });\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { operations } from "./openapi-types.js";
|
|
3
|
+
declare type queryParams = Pick<operations["withinExtentGet"]["parameters"]["query"], "xmin" | "ymin" | "xmax" | "ymax" | "categoryIds" | "pageSize" | "offset" | "searchText">;
|
|
4
|
+
declare type successResponse = operations["withinExtentGet"]["responses"]["200"]["content"]["application/json"];
|
|
5
|
+
/**
|
|
6
|
+
* The response format for {@linkcode findPlacesWithinExtent};
|
|
7
|
+
*/
|
|
8
|
+
export interface IFindPlacesWithinExtentResponse extends successResponse {
|
|
9
|
+
nextPage?: () => Promise<IFindPlacesWithinExtentResponse>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Options for {@linkcode findPlacesNearPoint}.
|
|
13
|
+
*/
|
|
14
|
+
export interface IFindPlaceWithinExtentOptions extends Omit<IRequestOptions, "httpMethod" | "f">, queryParams {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Searches the world-wide set of places for those that are within an
|
|
18
|
+
* extent, or bounding box. You must supply the `xmin`, `ymin`, `xmax` and
|
|
19
|
+
* `ymax` coordinates of the extent. You could use this endpoint to search
|
|
20
|
+
* for places in the visible extent of a user's screen.
|
|
21
|
+
*
|
|
22
|
+
* The returned places contain basic data such as name, category and
|
|
23
|
+
* location. You can use the {@linkcode getPlace} method to get additional
|
|
24
|
+
* details for a given place.
|
|
25
|
+
*
|
|
26
|
+
* You can also refine the results by supplying additional search parameters,
|
|
27
|
+
* including:
|
|
28
|
+
*
|
|
29
|
+
* - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.
|
|
30
|
+
* - A partial name filter with `name` option
|
|
31
|
+
*
|
|
32
|
+
* As this request can return many results, pagination is supported.
|
|
33
|
+
* Regardless of paging, the maximum number of places that can be returned
|
|
34
|
+
* by a single query is `200`. When a query results in more than `200`
|
|
35
|
+
* places, the response will contain the property
|
|
36
|
+
* `"maxResultsExceeded":true` in addition to place results. If `maxResultsExceeded`
|
|
37
|
+
* is true an additional method `response.nextPage()` can be used to get the next page of results.
|
|
38
|
+
*
|
|
39
|
+
* ```
|
|
40
|
+
* import { findPlacesWithinExtent } from "@esri/arcgis-rest-places";
|
|
41
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
42
|
+
*
|
|
43
|
+
* const results = await findPlacesWithinExtent({
|
|
44
|
+
* xmin: -118.013334,
|
|
45
|
+
* ymin: 33.78193,
|
|
46
|
+
* xmax: -117.795753,
|
|
47
|
+
* ymax: 33.873337,
|
|
48
|
+
* categoryIds: ["13002"],
|
|
49
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY");
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* console.log(results)
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function findPlacesWithinExtent(requestOptions: IFindPlaceWithinExtentOptions): Promise<IFindPlacesWithinExtentResponse>;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { request, appendCustomParams } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { baseUrl, hasNextPage, getNextPageParams } from "./utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* Searches the world-wide set of places for those that are within an
|
|
5
|
+
* extent, or bounding box. You must supply the `xmin`, `ymin`, `xmax` and
|
|
6
|
+
* `ymax` coordinates of the extent. You could use this endpoint to search
|
|
7
|
+
* for places in the visible extent of a user's screen.
|
|
8
|
+
*
|
|
9
|
+
* The returned places contain basic data such as name, category and
|
|
10
|
+
* location. You can use the {@linkcode getPlace} method to get additional
|
|
11
|
+
* details for a given place.
|
|
12
|
+
*
|
|
13
|
+
* You can also refine the results by supplying additional search parameters,
|
|
14
|
+
* including:
|
|
15
|
+
*
|
|
16
|
+
* - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.
|
|
17
|
+
* - A partial name filter with `name` option
|
|
18
|
+
*
|
|
19
|
+
* As this request can return many results, pagination is supported.
|
|
20
|
+
* Regardless of paging, the maximum number of places that can be returned
|
|
21
|
+
* by a single query is `200`. When a query results in more than `200`
|
|
22
|
+
* places, the response will contain the property
|
|
23
|
+
* `"maxResultsExceeded":true` in addition to place results. If `maxResultsExceeded`
|
|
24
|
+
* is true an additional method `response.nextPage()` can be used to get the next page of results.
|
|
25
|
+
*
|
|
26
|
+
* ```
|
|
27
|
+
* import { findPlacesWithinExtent } from "@esri/arcgis-rest-places";
|
|
28
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
29
|
+
*
|
|
30
|
+
* const results = await findPlacesWithinExtent({
|
|
31
|
+
* xmin: -118.013334,
|
|
32
|
+
* ymin: 33.78193,
|
|
33
|
+
* xmax: -117.795753,
|
|
34
|
+
* ymax: 33.873337,
|
|
35
|
+
* categoryIds: ["13002"],
|
|
36
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY");
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* console.log(results)
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function findPlacesWithinExtent(requestOptions) {
|
|
43
|
+
const options = appendCustomParams(requestOptions, [
|
|
44
|
+
"xmin",
|
|
45
|
+
"ymin",
|
|
46
|
+
"xmax",
|
|
47
|
+
"ymax",
|
|
48
|
+
"categoryIds",
|
|
49
|
+
"pageSize",
|
|
50
|
+
"offset",
|
|
51
|
+
"searchText"
|
|
52
|
+
], Object.assign({}, requestOptions));
|
|
53
|
+
return request(`${baseUrl}/places/within-extent`, Object.assign(Object.assign({}, options), { httpMethod: "GET" })).then((response) => {
|
|
54
|
+
const r = Object.assign({}, response);
|
|
55
|
+
if (hasNextPage(response)) {
|
|
56
|
+
r.nextPage = () => {
|
|
57
|
+
const nextOptions = Object.assign(Object.assign({}, requestOptions), getNextPageParams(requestOptions.offset, requestOptions.pageSize));
|
|
58
|
+
return findPlacesWithinExtent(nextOptions);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return r;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=findPlacesWithinExtent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findPlacesWithinExtent.js","sourceRoot":"","sources":["../../src/findPlacesWithinExtent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkCrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,sBAAsB,CACpC,cAA6C;IAE7C,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd;QACE,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACV,QAAQ;QACR,YAAY;KACb,oBAEI,cAAc,EAEpB,CAAC;IAEF,OACE,OAAO,CAAC,GAAG,OAAO,uBAAuB,kCACpC,OAAO,KACV,UAAU,EAAE,KAAK,IAEpB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QAClB,MAAM,CAAC,qBACF,QAAQ,CACZ,CAAC;QAEF,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE;YACzB,CAAC,CAAC,QAAQ,GAAG,GAAG,EAAE;gBAChB,MAAM,WAAW,mCACZ,cAAc,GACd,iBAAiB,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CACrE,CAAC;gBACF,OAAO,sBAAsB,CAAC,WAAW,CAAC,CAAC;YAC7C,CAAC,CAAC;SACH;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } from \"./utils.js\";\n\n// determine the list of allowed params we want to allow as options\n// this should match the array given to appendCustomParams below\ntype queryParams = Pick<\n operations[\"withinExtentGet\"][\"parameters\"][\"query\"],\n | \"xmin\"\n | \"ymin\"\n | \"xmax\"\n | \"ymax\"\n | \"categoryIds\"\n | \"pageSize\"\n | \"offset\"\n | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"withinExtentGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesWithinExtent};\n */\nexport interface IFindPlacesWithinExtentResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesWithinExtentResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlaceWithinExtentOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {}\n\n/**\n * Searches the world-wide set of places for those that are within an\n * extent, or bounding box. You must supply the `xmin`, `ymin`, `xmax` and\n * `ymax` coordinates of the extent. You could use this endpoint to search\n * for places in the visible extent of a user's screen.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlace} method to get additional\n * details for a given place.\n *\n * You can also refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * Regardless of paging, the maximum number of places that can be returned\n * by a single query is `200`. When a query results in more than `200`\n * places, the response will contain the property\n * `\"maxResultsExceeded\":true` in addition to place results. If `maxResultsExceeded`\n * is true an additional method `response.nextPage()` can be used to get the next page of results.\n *\n * ```\n * import { findPlacesWithinExtent } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const results = await findPlacesWithinExtent({\n * xmin: -118.013334,\n * ymin: 33.78193,\n * xmax: -117.795753,\n * ymax: 33.873337,\n * categoryIds: [\"13002\"],\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\");\n * });\n *\n * console.log(results)\n * ```\n */\nexport function findPlacesWithinExtent(\n requestOptions: IFindPlaceWithinExtentOptions\n): Promise<IFindPlacesWithinExtentResponse> {\n const options = appendCustomParams<IFindPlaceWithinExtentOptions>(\n requestOptions,\n [\n \"xmin\",\n \"ymin\",\n \"xmax\",\n \"ymax\",\n \"categoryIds\",\n \"pageSize\",\n \"offset\",\n \"searchText\"\n ],\n {\n ...requestOptions\n }\n );\n\n return (\n request(`${baseUrl}/places/within-extent`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesWithinExtentResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesWithinExtent(nextOptions);\n };\n }\n return r;\n });\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { operations } from "./openapi-types.js";
|
|
3
|
+
declare type queryParams = Pick<operations["categoriesGet"]["parameters"]["query"], "filter">;
|
|
4
|
+
declare type successResponse = operations["categoriesGet"]["responses"]["200"]["content"]["application/json"];
|
|
5
|
+
/**
|
|
6
|
+
* The response format for {@linkcode getCategories};
|
|
7
|
+
*/
|
|
8
|
+
export interface IGetCategoriesResponse extends successResponse {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Options for {@linkcode getCategories}.
|
|
12
|
+
*/
|
|
13
|
+
export interface IGetCategoriesOptions extends Omit<IRequestOptions, "httpMethod" | "f">, queryParams {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The ArcGIS Places service has many categories (or types) of place, from
|
|
17
|
+
* art museums to zoos. This endpoint returns all the categories including
|
|
18
|
+
* their label and `categoryId`. The category Id can be used to search for
|
|
19
|
+
* types of places with a `places/near-point` or `places/within-extent`
|
|
20
|
+
* request.
|
|
21
|
+
*
|
|
22
|
+
* Categories also have information on their `parent`. This allows you to
|
|
23
|
+
* search for specific categories such as "French Restaurant" - or to
|
|
24
|
+
* look for more generic types such as "Restaurant".
|
|
25
|
+
*
|
|
26
|
+
* ```js
|
|
27
|
+
* import { getCategories } from "@esri/arcgis-rest-places";
|
|
28
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
29
|
+
*
|
|
30
|
+
* const response = await getCategories({
|
|
31
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY")
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* console.log(response.categories);
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function getCategories(requestOptions: IGetCategoriesOptions): Promise<IGetCategoriesResponse>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { request, appendCustomParams } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { baseUrl } from "./utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* The ArcGIS Places service has many categories (or types) of place, from
|
|
5
|
+
* art museums to zoos. This endpoint returns all the categories including
|
|
6
|
+
* their label and `categoryId`. The category Id can be used to search for
|
|
7
|
+
* types of places with a `places/near-point` or `places/within-extent`
|
|
8
|
+
* request.
|
|
9
|
+
*
|
|
10
|
+
* Categories also have information on their `parent`. This allows you to
|
|
11
|
+
* search for specific categories such as "French Restaurant" - or to
|
|
12
|
+
* look for more generic types such as "Restaurant".
|
|
13
|
+
*
|
|
14
|
+
* ```js
|
|
15
|
+
* import { getCategories } from "@esri/arcgis-rest-places";
|
|
16
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
17
|
+
*
|
|
18
|
+
* const response = await getCategories({
|
|
19
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY")
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* console.log(response.categories);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export function getCategories(requestOptions) {
|
|
26
|
+
const options = appendCustomParams(requestOptions, ["filter"], Object.assign({}, requestOptions));
|
|
27
|
+
return request(`${baseUrl}/categories`, Object.assign(Object.assign({}, options), { httpMethod: "GET" }));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=getCategories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCategories.js","sourceRoot":"","sources":["../../src/getCategories.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAyBrC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,aAAa,CAC3B,cAAqC;IAErC,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd,CAAC,QAAQ,CAAC,oBAEL,cAAc,EAEpB,CAAC;IAEF,OAAO,OAAO,CAAC,GAAG,OAAO,aAAa,kCACjC,OAAO,KACV,UAAU,EAAE,KAAK,IACjB,CAAC;AACL,CAAC","sourcesContent":["import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl } from \"./utils.js\";\n\n// determine the list of allowed params we want to allow as options\n// this should match the array given to appendCustomParams below\ntype queryParams = Pick<\n operations[\"categoriesGet\"][\"parameters\"][\"query\"],\n \"filter\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"categoriesGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode getCategories};\n */\nexport interface IGetCategoriesResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getCategories}.\n */\nexport interface IGetCategoriesOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {}\n\n/**\n * The ArcGIS Places service has many categories (or types) of place, from\n * art museums to zoos. This endpoint returns all the categories including\n * their label and `categoryId`. The category Id can be used to search for\n * types of places with a `places/near-point` or `places/within-extent`\n * request.\n *\n * Categories also have information on their `parent`. This allows you to\n * search for specific categories such as \"French Restaurant\" - or to\n * look for more generic types such as \"Restaurant\".\n *\n * ```js\n * import { getCategories } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await getCategories({\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(response.categories);\n * ```\n */\nexport function getCategories(\n requestOptions: IGetCategoriesOptions\n): Promise<IGetCategoriesResponse> {\n const options = appendCustomParams<IGetCategoriesOptions>(\n requestOptions,\n [\"filter\"],\n {\n ...requestOptions\n }\n );\n\n return request(`${baseUrl}/categories`, {\n ...options,\n httpMethod: \"GET\"\n });\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { operations } from "./openapi-types.js";
|
|
3
|
+
declare type queryParams = operations["categoriesCategoryIdGet"]["parameters"]["query"];
|
|
4
|
+
declare type successResponse = operations["categoriesCategoryIdGet"]["responses"]["200"]["content"]["application/json"];
|
|
5
|
+
/**
|
|
6
|
+
* The response format for {@linkcode getCategory};
|
|
7
|
+
*/
|
|
8
|
+
export interface IGetCategoryResponse extends successResponse {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Options for {@linkcode getCategory}.
|
|
12
|
+
*/
|
|
13
|
+
export interface IGetCategoryOptions extends Omit<IRequestOptions, "httpMethod">, queryParams {
|
|
14
|
+
categoryId: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns details about a single category by Id.
|
|
18
|
+
*
|
|
19
|
+
* ```js
|
|
20
|
+
* import { getCategories } from "@esri/arcgis-rest-places";
|
|
21
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
22
|
+
*
|
|
23
|
+
* const response = getCategory({
|
|
24
|
+
* categoryId: "10000",
|
|
25
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY");
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* console.log(response);
|
|
29
|
+
* ```
|
|
30
|
+
**/
|
|
31
|
+
export declare function getCategory(requestOptions: IGetCategoryOptions): Promise<IGetCategoryResponse>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { request, appendCustomParams } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { baseUrl } from "./utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* Returns details about a single category by Id.
|
|
5
|
+
*
|
|
6
|
+
* ```js
|
|
7
|
+
* import { getCategories } from "@esri/arcgis-rest-places";
|
|
8
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
9
|
+
*
|
|
10
|
+
* const response = getCategory({
|
|
11
|
+
* categoryId: "10000",
|
|
12
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY");
|
|
13
|
+
* });
|
|
14
|
+
*
|
|
15
|
+
* console.log(response);
|
|
16
|
+
* ```
|
|
17
|
+
**/
|
|
18
|
+
export function getCategory(requestOptions) {
|
|
19
|
+
const { categoryId } = requestOptions;
|
|
20
|
+
const options = appendCustomParams(requestOptions, [], Object.assign({}, requestOptions));
|
|
21
|
+
return request(`${baseUrl}/categories/${categoryId}`, Object.assign(Object.assign({}, options), { httpMethod: "GET" }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=getCategory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCategory.js","sourceRoot":"","sources":["../../src/getCategory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAwBrC;;;;;;;;;;;;;;IAcI;AACJ,MAAM,UAAU,WAAW,CACzB,cAAmC;IAEnC,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC;IAEtC,MAAM,OAAO,GAAG,kBAAkB,CAAsB,cAAc,EAAE,EAAE,oBACrE,cAAc,EACjB,CAAC;IAEH,OAAO,OAAO,CAAC,GAAG,OAAO,eAAe,UAAU,EAAE,kCAC/C,OAAO,KACV,UAAU,EAAE,KAAK,IACjB,CAAC;AACL,CAAC","sourcesContent":["import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl } from \"./utils.js\";\n\n// determine the list of allowed params we want to allow as options\n// this should match the array given to appendCustomParams below\ntype queryParams = operations[\"categoriesCategoryIdGet\"][\"parameters\"][\"query\"];\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"categoriesCategoryIdGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode getCategory};\n */\nexport interface IGetCategoryResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getCategory}.\n */\nexport interface IGetCategoryOptions\n extends Omit<IRequestOptions, \"httpMethod\">,\n queryParams {\n categoryId: string;\n}\n\n/**\n * Returns details about a single category by Id.\n *\n * ```js\n * import { getCategories } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = getCategory({\n * categoryId: \"10000\",\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\");\n * });\n *\n * console.log(response);\n * ```\n **/\nexport function getCategory(\n requestOptions: IGetCategoryOptions\n): Promise<IGetCategoryResponse> {\n const { categoryId } = requestOptions;\n\n const options = appendCustomParams<IGetCategoryOptions>(requestOptions, [], {\n ...requestOptions\n });\n\n return request(`${baseUrl}/categories/${categoryId}`, {\n ...options,\n httpMethod: \"GET\"\n });\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { operations } from "./openapi-types.js";
|
|
3
|
+
declare type queryParams = Pick<operations["placeIdGet"]["parameters"]["query"], "requestedFields">;
|
|
4
|
+
declare type successResponse = operations["placeIdGet"]["responses"]["200"]["content"]["application/json"];
|
|
5
|
+
/**
|
|
6
|
+
* The response format for {@linkcode getPlace};
|
|
7
|
+
*/
|
|
8
|
+
export interface IGetPlaceResponse extends successResponse {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Options for {@linkcode getPlace}.
|
|
12
|
+
*/
|
|
13
|
+
export interface IGetPlaceOptions extends Omit<IRequestOptions, "httpMethod">, queryParams {
|
|
14
|
+
placeId: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns a single place, including additional details, such as:
|
|
18
|
+
*
|
|
19
|
+
* - contact details
|
|
20
|
+
* - address
|
|
21
|
+
* - price information
|
|
22
|
+
* - user rating
|
|
23
|
+
* - opening hours
|
|
24
|
+
*
|
|
25
|
+
* This endpoint can be used to fetch additional details for a specific
|
|
26
|
+
* place, returned from a places search request.
|
|
27
|
+
*
|
|
28
|
+
* Note that some fields, such as opening hours, are not available for
|
|
29
|
+
* every place. Where a field is not available it will be omitted from the
|
|
30
|
+
* response and you will not be charged for this data.
|
|
31
|
+
*
|
|
32
|
+
* ```js
|
|
33
|
+
* import { getPlaceDetails } from "@esri/arcgis-rest-places";
|
|
34
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
35
|
+
*
|
|
36
|
+
* const place = getPlaceDetails({
|
|
37
|
+
* placeId: "e78051acc722c55ab11ba930d8dd7772",
|
|
38
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY");
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* console.log(place);
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function getPlaceDetails(requestOptions: IGetPlaceOptions): Promise<IGetPlaceResponse>;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { request, appendCustomParams } from "@esri/arcgis-rest-request";
|
|
2
|
+
import { baseUrl } from "./utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* Returns a single place, including additional details, such as:
|
|
5
|
+
*
|
|
6
|
+
* - contact details
|
|
7
|
+
* - address
|
|
8
|
+
* - price information
|
|
9
|
+
* - user rating
|
|
10
|
+
* - opening hours
|
|
11
|
+
*
|
|
12
|
+
* This endpoint can be used to fetch additional details for a specific
|
|
13
|
+
* place, returned from a places search request.
|
|
14
|
+
*
|
|
15
|
+
* Note that some fields, such as opening hours, are not available for
|
|
16
|
+
* every place. Where a field is not available it will be omitted from the
|
|
17
|
+
* response and you will not be charged for this data.
|
|
18
|
+
*
|
|
19
|
+
* ```js
|
|
20
|
+
* import { getPlaceDetails } from "@esri/arcgis-rest-places";
|
|
21
|
+
* import { ApiKeyManager } from "@esri/arcgis-rest-request";
|
|
22
|
+
*
|
|
23
|
+
* const place = getPlaceDetails({
|
|
24
|
+
* placeId: "e78051acc722c55ab11ba930d8dd7772",
|
|
25
|
+
* authentication: ApiKeyManager.fromKey("YOUR_API_KEY");
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* console.log(place);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function getPlaceDetails(requestOptions) {
|
|
32
|
+
const { placeId } = requestOptions;
|
|
33
|
+
const options = appendCustomParams(requestOptions, ["requestedFields"], Object.assign({}, requestOptions));
|
|
34
|
+
return request(`${baseUrl}/places/${placeId}`, Object.assign(Object.assign({}, options), { httpMethod: "GET" }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=getPlaceDetails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPlaceDetails.js","sourceRoot":"","sources":["../../src/getPlaceDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA2BrC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,eAAe,CAC7B,cAAgC;IAEhC,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC;IAEnC,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd,CAAC,iBAAiB,CAAC,oBAEd,cAAc,EAEpB,CAAC;IAEF,OAAO,OAAO,CAAC,GAAG,OAAO,WAAW,OAAO,EAAE,kCACxC,OAAO,KACV,UAAU,EAAE,KAAK,IACjB,CAAC;AACL,CAAC","sourcesContent":["import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl } from \"./utils.js\";\n\n// determine the list of allowed params we want to allow as options\n// this should match the array given to appendCustomParams below\ntype queryParams = Pick<\n operations[\"placeIdGet\"][\"parameters\"][\"query\"],\n \"requestedFields\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"placeIdGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode getPlace};\n */\nexport interface IGetPlaceResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getPlace}.\n */\nexport interface IGetPlaceOptions\n extends Omit<IRequestOptions, \"httpMethod\">,\n queryParams {\n placeId: string;\n}\n\n/**\n * Returns a single place, including additional details, such as:\n *\n * - contact details\n * - address\n * - price information\n * - user rating\n * - opening hours\n *\n * This endpoint can be used to fetch additional details for a specific\n * place, returned from a places search request.\n *\n * Note that some fields, such as opening hours, are not available for\n * every place. Where a field is not available it will be omitted from the\n * response and you will not be charged for this data.\n *\n * ```js\n * import { getPlaceDetails } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const place = getPlaceDetails({\n * placeId: \"e78051acc722c55ab11ba930d8dd7772\",\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\");\n * });\n *\n * console.log(place);\n * ```\n */\nexport function getPlaceDetails(\n requestOptions: IGetPlaceOptions\n): Promise<IGetPlaceResponse> {\n const { placeId } = requestOptions;\n\n const options = appendCustomParams<IGetPlaceOptions>(\n requestOptions,\n [\"requestedFields\"],\n {\n ...requestOptions\n }\n );\n\n return request(`${baseUrl}/places/${placeId}`, {\n ...options,\n httpMethod: \"GET\"\n });\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* Copyright (c) 2023 Environmental Systems Research Institute, Inc.
|
|
2
|
+
* Apache-2.0 */
|
|
3
|
+
export * from "./findPlacesNearPoint.js";
|
|
4
|
+
export * from "./findPlacesWithinExtent.js";
|
|
5
|
+
export * from "./getPlaceDetails.js";
|
|
6
|
+
export * from "./getCategories.js";
|
|
7
|
+
export * from "./getCategory.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAMhB,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC","sourcesContent":["/* Copyright (c) 2023 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\n// Types that are used in this package are re-exported for convenience and\n// to make the links work correctly in the documentation pages.\nexport type {} from \"@esri/arcgis-rest-request\";\n\nexport * from \"./findPlacesNearPoint.js\";\nexport * from \"./findPlacesWithinExtent.js\";\nexport * from \"./getPlaceDetails.js\";\nexport * from \"./getCategories.js\";\nexport * from \"./getCategory.js\";\n"]}
|