@esri/arcgis-rest-geocoding 3.4.3 → 4.0.0-beta.4

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.
Files changed (52) hide show
  1. package/README.md +13 -14
  2. package/dist/bundled/geocoding.esm.js +530 -0
  3. package/dist/bundled/geocoding.esm.js.map +1 -0
  4. package/dist/bundled/geocoding.esm.min.js +12 -0
  5. package/dist/bundled/geocoding.esm.min.js.map +1 -0
  6. package/dist/bundled/geocoding.umd.js +544 -0
  7. package/dist/bundled/geocoding.umd.js.map +1 -0
  8. package/dist/bundled/geocoding.umd.min.js +13 -0
  9. package/dist/bundled/geocoding.umd.min.js.map +1 -0
  10. package/dist/{node → cjs}/bulk.js +12 -12
  11. package/dist/cjs/bulk.js.map +1 -0
  12. package/dist/{node → cjs}/geocode.js +22 -21
  13. package/dist/cjs/geocode.js.map +1 -0
  14. package/dist/{node → cjs}/helpers.js +4 -5
  15. package/dist/cjs/helpers.js.map +1 -0
  16. package/dist/cjs/index.js +11 -0
  17. package/dist/cjs/index.js.map +1 -0
  18. package/dist/cjs/package.json +3 -0
  19. package/dist/{node → cjs}/reverse.js +7 -7
  20. package/dist/cjs/reverse.js.map +1 -0
  21. package/dist/{node → cjs}/suggest.js +7 -7
  22. package/dist/cjs/suggest.js.map +1 -0
  23. package/dist/esm/bulk.d.ts +7 -6
  24. package/dist/esm/bulk.js +10 -10
  25. package/dist/esm/bulk.js.map +1 -1
  26. package/dist/esm/geocode.d.ts +10 -6
  27. package/dist/esm/geocode.js +16 -15
  28. package/dist/esm/geocode.js.map +1 -1
  29. package/dist/esm/helpers.js +4 -5
  30. package/dist/esm/helpers.js.map +1 -1
  31. package/dist/esm/index.d.ts +6 -6
  32. package/dist/esm/index.js +5 -5
  33. package/dist/esm/index.js.map +1 -1
  34. package/dist/esm/package.json +3 -0
  35. package/dist/esm/reverse.d.ts +4 -3
  36. package/dist/esm/reverse.js +6 -6
  37. package/dist/esm/reverse.js.map +1 -1
  38. package/dist/esm/suggest.d.ts +3 -2
  39. package/dist/esm/suggest.js +6 -6
  40. package/dist/esm/suggest.js.map +1 -1
  41. package/package.json +56 -42
  42. package/dist/node/bulk.js.map +0 -1
  43. package/dist/node/geocode.js.map +0 -1
  44. package/dist/node/helpers.js.map +0 -1
  45. package/dist/node/index.js +0 -11
  46. package/dist/node/index.js.map +0 -1
  47. package/dist/node/reverse.js.map +0 -1
  48. package/dist/node/suggest.js.map +0 -1
  49. package/dist/umd/geocoding.umd.js +0 -565
  50. package/dist/umd/geocoding.umd.js.map +0 -1
  51. package/dist/umd/geocoding.umd.min.js +0 -12
  52. package/dist/umd/geocoding.umd.min.js.map +0 -1
@@ -1,18 +1,19 @@
1
1
  /* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc.
2
2
  * Apache-2.0 */
3
- import { __assign } from "tslib";
4
3
  import { request, cleanUrl, appendCustomParams } from "@esri/arcgis-rest-request";
5
- import { ARCGIS_ONLINE_GEOCODING_URL } from "./helpers";
4
+ import { ARCGIS_ONLINE_GEOCODING_URL } from "./helpers.js";
6
5
  import { arcgisToGeoJSON } from "@terraformer/arcgis";
7
6
  /**
8
- * ```js
7
+ * Used to determine the location of a single address or point of interest. See the [REST Documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) for more information.
8
+ *
9
+ * ```js
9
10
  * import { geocode } from '@esri/arcgis-rest-geocoding';
10
- * //
11
+ *
11
12
  * geocode("LAX")
12
13
  * .then((response) => {
13
14
  * response.candidates[0].location; // => { x: -118.409, y: 33.943, spatialReference: ... }
14
15
  * });
15
- * //
16
+ *
16
17
  * geocode({
17
18
  * address: "1600 Pennsylvania Ave",
18
19
  * postal: 20500,
@@ -22,13 +23,13 @@ import { arcgisToGeoJSON } from "@terraformer/arcgis";
22
23
  * response.candidates[1].location; // => { x: -77.036533, y: 38.898719, spatialReference: ... }
23
24
  * });
24
25
  * ```
25
- * Used to determine the location of a single address or point of interest. See the [REST Documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) for more information.
26
+ *
26
27
  * @param address String representing the address or point of interest or RequestOptions to pass to the endpoint.
27
28
  * @returns A Promise that will resolve with address candidates for the request. The spatial reference will be added to candidate locations and extents unless `rawResponse: true` was passed.
28
29
  */
29
30
  export function geocode(address) {
30
- var options = {};
31
- var endpoint;
31
+ let options = {};
32
+ let endpoint;
32
33
  if (typeof address === "string") {
33
34
  options.params = { singleLine: address };
34
35
  endpoint = ARCGIS_ONLINE_GEOCODING_URL;
@@ -49,14 +50,14 @@ export function geocode(address) {
49
50
  "countryCode",
50
51
  "outFields",
51
52
  "magicKey"
52
- ], { params: __assign({}, address.params) });
53
+ ], { params: Object.assign({}, address.params) });
53
54
  }
54
55
  // add spatialReference property to individual matches
55
- return request(cleanUrl(endpoint) + "/findAddressCandidates", options).then(function (response) {
56
+ return request(`${cleanUrl(endpoint)}/findAddressCandidates`, options).then((response) => {
56
57
  if (typeof address !== "string" && address.rawResponse) {
57
58
  return response;
58
59
  }
59
- var sr = response.spatialReference;
60
+ const sr = response.spatialReference;
60
61
  response.candidates.forEach(function (candidate) {
61
62
  candidate.location.spatialReference = sr;
62
63
  if (candidate.extent) {
@@ -65,19 +66,19 @@ export function geocode(address) {
65
66
  });
66
67
  // geoJson
67
68
  if (sr.wkid === 4326) {
68
- var features = response.candidates.map(function (candidate) {
69
+ const features = response.candidates.map((candidate) => {
69
70
  return {
70
71
  type: "Feature",
71
72
  geometry: arcgisToGeoJSON(candidate.location),
72
73
  properties: Object.assign({
73
74
  address: candidate.address,
74
- score: candidate.score,
75
- }, candidate.attributes),
75
+ score: candidate.score
76
+ }, candidate.attributes)
76
77
  };
77
78
  });
78
79
  response.geoJson = {
79
80
  type: "FeatureCollection",
80
- features: features,
81
+ features
81
82
  };
82
83
  }
83
84
  return response;
@@ -1 +1 @@
1
- {"version":3,"file":"geocode.js","sourceRoot":"","sources":["../../src/geocode.ts"],"names":[],"mappings":"AAAA;gB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AAC;YACJ,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,OAAO,GAAG;gBACjB,IAAI,EAAE,mBAAmB;gBACzB,QAAQ;aACT,CAAC;SACH;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["/* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\nimport {\n request,\n cleanUrl,\n appendCustomParams,\n IExtent,\n ISpatialReference,\n IPoint\n} from \"@esri/arcgis-rest-request\";\n\nimport { ARCGIS_ONLINE_GEOCODING_URL, IEndpointOptions } from \"./helpers.js\";\n\nimport { arcgisToGeoJSON } from \"@terraformer/arcgis\";\n\nexport interface IGeocodeOptions extends IEndpointOptions {\n /**\n * use this if all your address info is contained in a single string.\n */\n singleLine?: string;\n address?: string;\n address2?: string;\n address3?: string;\n neighborhood?: string;\n city?: string;\n subregion?: string;\n outFields?: \"*\" | string[];\n /**\n * The World Geocoding Service expects US states to be passed in as a 'region'.\n */\n region?: string;\n postal?: number;\n postalExt?: number;\n countryCode?: string;\n /**\n * You can create an autocomplete experience by making a call to suggest with partial text and then passing through the magicKey and complete address that are returned to geocode.\n *\n * ```js\n * import { suggest, geocode } from '@esri/arcgis-rest-geocoding';\n *\n * suggest(\"LAX\")\n * .then((response) => {\n * geocode({\n * singleLine: response.suggestions[1].text,\n * magicKey: response.suggestions[0].magicKey\n * })\n * })\n * ```\n */\n magicKey?: string;\n}\n\nexport interface IGeocodeResponse {\n spatialReference: ISpatialReference;\n candidates: Array<{\n address: string;\n location: IPoint;\n extent?: IExtent;\n score: number;\n attributes: object;\n }>;\n geoJson?: {\n type: string;\n features: Array<{\n type: string;\n geometry: object;\n properties: any;\n }>;\n };\n}\n\n/**\n * Used to determine the location of a single address or point of interest. See the [REST Documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) for more information.\n *\n * ```js\n * import { geocode } from '@esri/arcgis-rest-geocoding';\n *\n * geocode(\"LAX\")\n * .then((response) => {\n * response.candidates[0].location; // => { x: -118.409, y: 33.943, spatialReference: ... }\n * });\n *\n * geocode({\n * address: \"1600 Pennsylvania Ave\",\n * postal: 20500,\n * countryCode: \"USA\"\n * })\n * .then((response) => {\n * response.candidates[1].location; // => { x: -77.036533, y: 38.898719, spatialReference: ... }\n * });\n * ```\n *\n * @param address String representing the address or point of interest or RequestOptions to pass to the endpoint.\n * @returns A Promise that will resolve with address candidates for the request. The spatial reference will be added to candidate locations and extents unless `rawResponse: true` was passed.\n */\nexport function geocode(\n address: string | IGeocodeOptions\n): Promise<IGeocodeResponse> {\n let options: IGeocodeOptions = {};\n let endpoint: string;\n\n if (typeof address === \"string\") {\n options.params = { singleLine: address };\n endpoint = ARCGIS_ONLINE_GEOCODING_URL;\n } else {\n endpoint = address.endpoint || ARCGIS_ONLINE_GEOCODING_URL;\n options = appendCustomParams<IGeocodeOptions>(\n address,\n [\n \"singleLine\",\n \"address\",\n \"address2\",\n \"address3\",\n \"neighborhood\",\n \"city\",\n \"subregion\",\n \"region\",\n \"postal\",\n \"postalExt\",\n \"countryCode\",\n \"outFields\",\n \"magicKey\"\n ],\n { params: { ...address.params } }\n );\n }\n\n // add spatialReference property to individual matches\n return request(`${cleanUrl(endpoint)}/findAddressCandidates`, options).then(\n (response) => {\n if (typeof address !== \"string\" && address.rawResponse) {\n return response;\n }\n const sr: ISpatialReference = response.spatialReference;\n response.candidates.forEach(function (candidate: {\n location: IPoint;\n extent?: IExtent;\n }) {\n candidate.location.spatialReference = sr;\n if (candidate.extent) {\n candidate.extent.spatialReference = sr;\n }\n });\n\n // geoJson\n if (sr.wkid === 4326) {\n const features = response.candidates.map((candidate: any) => {\n return {\n type: \"Feature\",\n geometry: arcgisToGeoJSON(candidate.location),\n properties: Object.assign(\n {\n address: candidate.address,\n score: candidate.score\n },\n candidate.attributes\n )\n };\n });\n\n response.geoJson = {\n type: \"FeatureCollection\",\n features\n };\n }\n\n return response;\n }\n );\n}\n"]}
@@ -1,10 +1,9 @@
1
1
  /* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
2
2
  * Apache-2.0 */
3
- import { __assign } from "tslib";
4
3
  import { request } from "@esri/arcgis-rest-request";
5
4
  // https always
6
- export var ARCGIS_ONLINE_GEOCODING_URL = "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/";
7
- export var ARCGIS_ONLINE_BULK_GEOCODING_URL = "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/";
5
+ export const ARCGIS_ONLINE_GEOCODING_URL = "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/";
6
+ export const ARCGIS_ONLINE_BULK_GEOCODING_URL = "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/";
8
7
  /**
9
8
  * Used to fetch metadata from a geocoding service.
10
9
  *
@@ -21,8 +20,8 @@ export var ARCGIS_ONLINE_BULK_GEOCODING_URL = "https://geocode.arcgis.com/arcgis
21
20
  * @returns A Promise that will resolve with the data from the response.
22
21
  */
23
22
  export function getGeocodeService(requestOptions) {
24
- var url = (requestOptions && requestOptions.endpoint) || ARCGIS_ONLINE_GEOCODING_URL;
25
- var options = __assign({ httpMethod: "GET", maxUrlLength: 2000 }, requestOptions);
23
+ const url = (requestOptions && requestOptions.endpoint) || ARCGIS_ONLINE_GEOCODING_URL;
24
+ const options = Object.assign({ httpMethod: "GET", maxUrlLength: 2000 }, requestOptions);
26
25
  return request(url, options);
27
26
  }
28
27
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA;gBACgB;;AAEhB,OAAO,EAAE,OAAO,EAAmB,MAAM,2BAA2B,CAAC;AAErE,eAAe;AACf,MAAM,CAAC,IAAM,2BAA2B,GACtC,0EAA0E,CAAC;AAC7E,MAAM,CAAC,IAAM,gCAAgC,GAC3C,sEAAsE,CAAC;AAkBzE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAC/B,cAAiC;IAEjC,IAAM,GAAG,GACP,CAAC,cAAc,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,2BAA2B,CAAC;IAE7E,IAAM,OAAO,cACX,UAAU,EAAE,KAAK,EACjB,YAAY,EAAE,IAAI,IACf,cAAc,CAClB,CAAC;IAEF,OAAO,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,OAAO,EAAE,OAAO,EAAmB,MAAM,2BAA2B,CAAC;AAErE,eAAe;AACf,MAAM,CAAC,MAAM,2BAA2B,GACtC,0EAA0E,CAAC;AAC7E,MAAM,CAAC,MAAM,gCAAgC,GAC3C,sEAAsE,CAAC;AAkBzE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAC/B,cAAiC;IAEjC,MAAM,GAAG,GACP,CAAC,cAAc,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,2BAA2B,CAAC;IAE7E,MAAM,OAAO,mBACX,UAAU,EAAE,KAAK,EACjB,YAAY,EAAE,IAAI,IACf,cAAc,CAClB,CAAC;IAEF,OAAO,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["/* Copyright (c) 2017 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\nimport { request, IRequestOptions } from \"@esri/arcgis-rest-request\";\n\n// https always\nexport const ARCGIS_ONLINE_GEOCODING_URL =\n \"https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/\";\nexport const ARCGIS_ONLINE_BULK_GEOCODING_URL =\n \"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/\";\n\n// nice to have: verify custom endpoints contain 'GeocodeServer' and end in a '/'\nexport interface IEndpointOptions extends IRequestOptions {\n /**\n * Any ArcGIS Geocoding service (example: http://sampleserver6.arcgisonline.com/arcgis/rest/services/Locators/SanDiego/GeocodeServer )\n */\n endpoint?: string;\n}\n\nexport interface IGetGeocodeServiceResponse {\n currentVersion: number;\n serviceDescription: string;\n addressFields: any[];\n countries: string[];\n capabilities: string;\n}\n\n/**\n * Used to fetch metadata from a geocoding service.\n *\n * ```js\n * import { getGeocoderServiceInfo } from '@esri/arcgis-rest-geocoding';\n *\n * getGeocoderServiceInfo()\n * .then((response) => {\n * response.serviceDescription; // => 'World Geocoder'\n * });\n * ```\n *\n * @param requestOptions - Request options can contain a custom geocoding service to fetch metadata from.\n * @returns A Promise that will resolve with the data from the response.\n */\nexport function getGeocodeService(\n requestOptions?: IEndpointOptions\n): Promise<IGetGeocodeServiceResponse> {\n const url =\n (requestOptions && requestOptions.endpoint) || ARCGIS_ONLINE_GEOCODING_URL;\n\n const options: IEndpointOptions = {\n httpMethod: \"GET\",\n maxUrlLength: 2000,\n ...requestOptions\n };\n\n return request(url, options);\n}\n"]}
@@ -1,6 +1,6 @@
1
- export * from "./geocode";
2
- export * from "./suggest";
3
- export * from "./reverse";
4
- export * from "./bulk";
5
- export * from "./helpers";
6
- export { IPoint, ILocation, IExtent, ISpatialReference } from "@esri/arcgis-rest-types";
1
+ export * from "./geocode.js";
2
+ export * from "./suggest.js";
3
+ export * from "./reverse.js";
4
+ export * from "./bulk.js";
5
+ export * from "./helpers.js";
6
+ export type { IPoint, ILocation, IExtent, ISpatialReference } from "@esri/arcgis-rest-request";
package/dist/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
2
2
  * Apache-2.0 */
3
- export * from "./geocode";
4
- export * from "./suggest";
5
- export * from "./reverse";
6
- export * from "./bulk";
7
- export * from "./helpers";
3
+ export * from "./geocode.js";
4
+ export * from "./suggest.js";
5
+ export * from "./reverse.js";
6
+ export * from "./bulk.js";
7
+ export * from "./helpers.js";
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC","sourcesContent":["/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\nexport * from \"./geocode.js\";\nexport * from \"./suggest.js\";\nexport * from \"./reverse.js\";\nexport * from \"./bulk.js\";\nexport * from \"./helpers.js\";\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 {\n IPoint,\n ILocation,\n IExtent,\n ISpatialReference\n} from \"@esri/arcgis-rest-request\";\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -1,5 +1,5 @@
1
- import { IPoint, ILocation } from "@esri/arcgis-rest-types";
2
- import { IEndpointOptions } from "./helpers";
1
+ import { IPoint, ILocation } from "@esri/arcgis-rest-request";
2
+ import { IEndpointOptions } from "./helpers.js";
3
3
  export interface IReverseGeocodeResponse {
4
4
  address: {
5
5
  [key: string]: any;
@@ -7,6 +7,8 @@ export interface IReverseGeocodeResponse {
7
7
  location: IPoint;
8
8
  }
9
9
  /**
10
+ * Used to determine the address of a [location](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-reverse-geocode.htm).
11
+ *
10
12
  * ```js
11
13
  * import { reverseGeocode } from '@esri/arcgis-rest-geocoding';
12
14
  * //
@@ -20,7 +22,6 @@ export interface IReverseGeocodeResponse {
20
22
  * reverseGeocode({ x: -118.409, y: 33.9425 }) // wgs84 is assumed
21
23
  * reverseGeocode({ x: -13181226, y: 4021085, spatialReference: { wkid: 3857 })
22
24
  * ```
23
- * Used to determine the address of a [location](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-reverse-geocode.htm).
24
25
  *
25
26
  * @param coordinates - the location you'd like to associate an address with.
26
27
  * @param requestOptions - Additional options for the request including authentication.
@@ -1,8 +1,7 @@
1
1
  /* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc.
2
2
  * Apache-2.0 */
3
- import { __assign } from "tslib";
4
3
  import { request, cleanUrl } from "@esri/arcgis-rest-request";
5
- import { ARCGIS_ONLINE_GEOCODING_URL } from "./helpers";
4
+ import { ARCGIS_ONLINE_GEOCODING_URL } from "./helpers.js";
6
5
  function isLocationArray(coords) {
7
6
  return (coords.length === 2 ||
8
7
  coords.length === 3);
@@ -12,6 +11,8 @@ function isLocation(coords) {
12
11
  coords.lat !== undefined);
13
12
  }
14
13
  /**
14
+ * Used to determine the address of a [location](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-reverse-geocode.htm).
15
+ *
15
16
  * ```js
16
17
  * import { reverseGeocode } from '@esri/arcgis-rest-geocoding';
17
18
  * //
@@ -25,14 +26,13 @@ function isLocation(coords) {
25
26
  * reverseGeocode({ x: -118.409, y: 33.9425 }) // wgs84 is assumed
26
27
  * reverseGeocode({ x: -13181226, y: 4021085, spatialReference: { wkid: 3857 })
27
28
  * ```
28
- * Used to determine the address of a [location](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-reverse-geocode.htm).
29
29
  *
30
30
  * @param coordinates - the location you'd like to associate an address with.
31
31
  * @param requestOptions - Additional options for the request including authentication.
32
32
  * @returns A Promise that will resolve with the data from the response.
33
33
  */
34
34
  export function reverseGeocode(coords, requestOptions) {
35
- var options = __assign({ endpoint: ARCGIS_ONLINE_GEOCODING_URL, params: {} }, requestOptions);
35
+ const options = Object.assign({ endpoint: ARCGIS_ONLINE_GEOCODING_URL, params: {} }, requestOptions);
36
36
  if (isLocationArray(coords)) {
37
37
  options.params.location = coords.join();
38
38
  }
@@ -48,9 +48,9 @@ export function reverseGeocode(coords, requestOptions) {
48
48
  // if input is a point, we can pass it straight through, with or without a spatial reference
49
49
  options.params.location = coords;
50
50
  }
51
- return request(cleanUrl(options.endpoint) + "/reverseGeocode", options);
51
+ return request(`${cleanUrl(options.endpoint)}/reverseGeocode`, options);
52
52
  }
53
53
  export default {
54
- reverseGeocode: reverseGeocode
54
+ reverseGeocode
55
55
  };
56
56
  //# sourceMappingURL=reverse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reverse.js","sourceRoot":"","sources":["../../src/reverse.ts"],"names":[],"mappings":"AAAA;gBACgB;;AAEhB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAI9D,OAAO,EAAE,2BAA2B,EAAoB,MAAM,WAAW,CAAC;AAS1E,SAAS,eAAe,CACtB,MAAwE;IAExE,OAAO,CACJ,MAA2B,CAAC,MAAM,KAAK,CAAC;QACxC,MAAmC,CAAC,MAAM,KAAK,CAAC,CAClD,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CACjB,MAAwE;IAExE,OAAO,CACJ,MAAoB,CAAC,QAAQ,KAAK,SAAS;QAC3C,MAAoB,CAAC,GAAG,KAAK,SAAS,CACxC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,cAAc,CAC5B,MAA6C,EAC7C,cAAiC;IAEjC,IAAM,OAAO,cACX,QAAQ,EAAE,2BAA2B,EACrC,MAAM,EAAE,EAAE,IACP,cAAc,CAClB,CAAC;IAEF,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE;QAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;KACzC;SAAM,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE;QAC7B,IAAI,MAAM,CAAC,GAAG,EAAE;YACd,OA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G,MAAM,CAAC,IAAI,EAAE,CAAC;KACzC;SAAM,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE;QAC7B,IAAI,MAAM,CAAC,GAAG,EAAE;YACd,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;SAC1D;QACD,IAAI,MAAM,CAAC,QAAQ,EAAE;YACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,SAAS,GAAG,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;SACpE;KACF;SAAM;QACL,4FAA4F;QAC5F,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC;KAClC;IAED,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAC1E,CAAC;AAED,eAAe;IACb,cAAc;CACf,CAAC","sourcesContent":["/* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\nimport {\n request,\n cleanUrl,\n IPoint,\n ILocation\n} from \"@esri/arcgis-rest-request\";\n\nimport { ARCGIS_ONLINE_GEOCODING_URL, IEndpointOptions } from \"./helpers.js\";\n\nexport interface IReverseGeocodeResponse {\n address: {\n [key: string]: any;\n };\n location: IPoint;\n}\n\nfunction isLocationArray(\n coords: ILocation | IPoint | [number, number] | [number, number, number]\n): coords is [number, number] | [number, number, number] {\n return (\n (coords as [number, number]).length === 2 ||\n (coords as [number, number, number]).length === 3\n );\n}\n\nfunction isLocation(\n coords: ILocation | IPoint | [number, number] | [number, number, number]\n): coords is ILocation {\n return (\n (coords as ILocation).latitude !== undefined ||\n (coords as ILocation).lat !== undefined\n );\n}\n\n/**\n * Used to determine the address of a [location](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-reverse-geocode.htm).\n *\n * ```js\n * import { reverseGeocode } from '@esri/arcgis-rest-geocoding';\n * //\n * reverseGeocode([-118.409,33.943 ]) // long, lat\n * .then((response) => {\n * response.address.PlaceName; // => \"LA Airport\"\n * });\n * // or\n * reverseGeocode({ long: -118.409, lat: 33.943 })\n * reverseGeocode({ latitude: 33.943, latitude: -118.409 })\n * reverseGeocode({ x: -118.409, y: 33.9425 }) // wgs84 is assumed\n * reverseGeocode({ x: -13181226, y: 4021085, spatialReference: { wkid: 3857 })\n * ```\n *\n * @param coordinates - the location you'd like to associate an address with.\n * @param requestOptions - Additional options for the request including authentication.\n * @returns A Promise that will resolve with the data from the response.\n */\nexport function reverseGeocode(\n coords: IPoint | ILocation | [number, number],\n requestOptions?: IEndpointOptions\n): Promise<IReverseGeocodeResponse> {\n const options: IEndpointOptions = {\n endpoint: ARCGIS_ONLINE_GEOCODING_URL,\n params: {},\n ...requestOptions\n };\n\n if (isLocationArray(coords)) {\n options.params.location = coords.join();\n } else if (isLocation(coords)) {\n if (coords.lat) {\n options.params.location = coords.long + \",\" + coords.lat;\n }\n if (coords.latitude) {\n options.params.location = coords.longitude + \",\" + coords.latitude;\n }\n } else {\n // if input is a point, we can pass it straight through, with or without a spatial reference\n options.params.location = coords;\n }\n\n return request(`${cleanUrl(options.endpoint)}/reverseGeocode`, options);\n}\n\nexport default {\n reverseGeocode\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { IEndpointOptions } from "./helpers";
1
+ import { IEndpointOptions } from "./helpers.js";
2
2
  export interface ISuggestResponse {
3
3
  suggestions: Array<{
4
4
  text: string;
@@ -7,13 +7,14 @@ export interface ISuggestResponse {
7
7
  }>;
8
8
  }
9
9
  /**
10
+ * Used to return a placename [suggestion](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) for a partial string.
11
+ *
10
12
  * ```js
11
13
  * import { suggest } from '@esri/arcgis-rest-geocoding';
12
14
  * //
13
15
  * suggest("Starb")
14
16
  * .then(response) // response.text === "Starbucks"
15
17
  * ```
16
- * Used to return a placename [suggestion](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) for a partial string.
17
18
  *
18
19
  * @param requestOptions - Options for the request including authentication and other optional parameters.
19
20
  * @returns A Promise that will resolve with the data from the response.
@@ -1,26 +1,26 @@
1
1
  /* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc.
2
2
  * Apache-2.0 */
3
- import { __assign } from "tslib";
4
3
  import { request, cleanUrl } from "@esri/arcgis-rest-request";
5
- import { ARCGIS_ONLINE_GEOCODING_URL } from "./helpers";
4
+ import { ARCGIS_ONLINE_GEOCODING_URL } from "./helpers.js";
6
5
  /**
6
+ * Used to return a placename [suggestion](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) for a partial string.
7
+ *
7
8
  * ```js
8
9
  * import { suggest } from '@esri/arcgis-rest-geocoding';
9
10
  * //
10
11
  * suggest("Starb")
11
12
  * .then(response) // response.text === "Starbucks"
12
13
  * ```
13
- * Used to return a placename [suggestion](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) for a partial string.
14
14
  *
15
15
  * @param requestOptions - Options for the request including authentication and other optional parameters.
16
16
  * @returns A Promise that will resolve with the data from the response.
17
17
  */
18
18
  export function suggest(partialText, requestOptions) {
19
- var options = __assign({ endpoint: ARCGIS_ONLINE_GEOCODING_URL, params: {} }, requestOptions);
19
+ const options = Object.assign({ endpoint: ARCGIS_ONLINE_GEOCODING_URL, params: {} }, requestOptions);
20
20
  options.params.text = partialText;
21
- return request(cleanUrl(options.endpoint) + "/suggest", options);
21
+ return request(`${cleanUrl(options.endpoint)}/suggest`, options);
22
22
  }
23
23
  export default {
24
- suggest: suggest
24
+ suggest
25
25
  };
26
26
  //# sourceMappingURL=suggest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"suggest.js","sourceRoot":"","sources":["../../src/suggest.ts"],"names":[],"mappings":"AAAA;gBACgB;;AAEhB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,2BAA2B,EAAoB,MAAM,WAAW,CAAC;AAU1E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,OAAO,CACrB,WAAmB,EACnB,cAAiC;IAEjC,IAAM,OAAO,cACX,QAAQ,EAAE,2BAA2B,EACrC,MAAM,EAAE,EAAE,IACP,cAAc,CAClB,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,WAAW,CAAC;IAElC,OAAO,OAAO,CAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAU,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC;AAED,eAAe;IACb,OAAO,SAAA;CACR,CAAC"}
1
+ {"version":3,"file":"suggest.js","sourceRoot":"","sources":["../../src/suggest.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,2BAA2B,EAAoB,MAAM,cAAc,CAAC;AAU7E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,OAAO,CACrB,WAAmB,EACnB,cAAiC;IAEjC,MAAM,OAAO,mBACX,QAAQ,EAAE,2BAA2B,EACrC,MAAM,EAAE,EAAE,IACP,cAAc,CAClB,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,WAAW,CAAC;IAElC,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC;AAED,eAAe;IACb,OAAO;CACR,CAAC","sourcesContent":["/* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\nimport { request, cleanUrl } from \"@esri/arcgis-rest-request\";\n\nimport { ARCGIS_ONLINE_GEOCODING_URL, IEndpointOptions } from \"./helpers.js\";\n\nexport interface ISuggestResponse {\n suggestions: Array<{\n text: string;\n magicKey: string;\n isCollection: boolean;\n }>;\n}\n\n/**\n * Used to return a placename [suggestion](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) for a partial string.\n *\n * ```js\n * import { suggest } from '@esri/arcgis-rest-geocoding';\n * //\n * suggest(\"Starb\")\n * .then(response) // response.text === \"Starbucks\"\n * ```\n *\n * @param requestOptions - Options for the request including authentication and other optional parameters.\n * @returns A Promise that will resolve with the data from the response.\n */\nexport function suggest(\n partialText: string,\n requestOptions?: IEndpointOptions\n): Promise<ISuggestResponse> {\n const options: IEndpointOptions = {\n endpoint: ARCGIS_ONLINE_GEOCODING_URL,\n params: {},\n ...requestOptions\n };\n\n options.params.text = partialText;\n\n return request(`${cleanUrl(options.endpoint)}/suggest`, options);\n}\n\nexport default {\n suggest\n};\n"]}
package/package.json CHANGED
@@ -1,66 +1,80 @@
1
1
  {
2
2
  "name": "@esri/arcgis-rest-geocoding",
3
- "version": "3.4.3",
3
+ "version": "4.0.0-beta.4",
4
4
  "description": "Geocoding helpers for @esri/arcgis-rest-js",
5
- "main": "dist/node/index.js",
6
- "unpkg": "dist/umd/geocoding.umd.js",
5
+ "license": "Apache-2.0",
6
+ "keywords": [
7
+ "ES6",
8
+ "arcgis",
9
+ "esri",
10
+ "fetch",
11
+ "promise",
12
+ "typescript"
13
+ ],
14
+ "type": "module",
15
+ "main": "dist/cjs/index.js",
7
16
  "module": "dist/esm/index.js",
8
- "js:next": "dist/esm/index.js",
9
- "sideEffects": false,
17
+ "unpkg": "dist/bundled/geocoding.umd.min.js",
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/esm/index.js",
21
+ "require": "./dist/cjs/index.js"
22
+ }
23
+ },
10
24
  "types": "dist/esm/index.d.ts",
11
- "license": "Apache-2.0",
25
+ "sideEffects": false,
12
26
  "files": [
13
27
  "dist/**"
14
28
  ],
29
+ "scripts": {
30
+ "build": "npm-run-all --parallel build:*",
31
+ "postbuild": "node ../../scripts/create-dist-package-jsons.js",
32
+ "build:bundled": "rollup -c ../../rollup.js",
33
+ "build:cjs": "tsc --outDir ./dist/cjs -m commonjs",
34
+ "postbuild:cjs": "node ../../scripts/create-dist-package-jsons.js",
35
+ "build:esm": "tsc --outDir ./dist/esm --declaration",
36
+ "postbuild:esm": "node ../../scripts/create-dist-package-jsons.js",
37
+ "dev": "npm-run-all --parallel dev:*",
38
+ "dev:bundled": "rollup -w -c ../../rollup.js",
39
+ "dev:cjs": "tsc -w --outDir ./dist/cjs -m commonjs",
40
+ "dev:esm": "tsc -w --outDir ./dist/esm --declaration"
41
+ },
42
+ "engines": {
43
+ "node": ">=12.20.0"
44
+ },
15
45
  "dependencies": {
16
- "@esri/arcgis-rest-types": "^3.4.3",
17
46
  "@terraformer/arcgis": "^2.0.7",
18
47
  "@types/terraformer__arcgis": "^2.0.0",
19
- "tslib": "^1.13.0"
20
- },
21
- "devDependencies": {
22
- "@esri/arcgis-rest-auth": "^3.4.3",
23
- "@esri/arcgis-rest-request": "^3.4.3"
48
+ "tslib": "^2.3.0"
24
49
  },
25
50
  "peerDependencies": {
26
- "@esri/arcgis-rest-auth": "^3.0.0",
27
- "@esri/arcgis-rest-request": "^3.0.0"
28
- },
29
- "scripts": {
30
- "prepare": "npm run build",
31
- "build": "npm run build:node && npm run build:umd && npm run build:esm",
32
- "build:esm": "tsc --module es2015 --outDir ./dist/esm --declaration",
33
- "build:umd": "rollup -c ../../umd-base-profile.js && rollup -c ../../umd-production-profile.js",
34
- "build:node": "tsc --module commonjs --outDir ./dist/node",
35
- "dev:esm": "tsc -w --module es2015 --outDir ./dist/esm --declaration",
36
- "dev:umd": "rollup -w -c ../../umd-base-profile.js",
37
- "dev:node": "tsc -w --module commonjs --outDir ./dist/node"
51
+ "@esri/arcgis-rest-request": "4.0.0-beta.10"
38
52
  },
39
- "publishConfig": {
40
- "access": "public"
53
+ "devDependencies": {
54
+ "@esri/arcgis-rest-request": "4.0.0-beta.10"
41
55
  },
56
+ "contributors": [
57
+ "Patrick Arlt <parlt@esri.com> (http://patrickarlt.com/)"
58
+ ],
59
+ "homepage": "https://github.com/Esri/arcgis-rest-js#readme",
42
60
  "repository": {
43
61
  "type": "git",
44
62
  "url": "git+https://github.com/Esri/arcgis-rest-js.git",
45
63
  "directory": "packages/arcgis-rest-geocoding"
46
64
  },
47
- "contributors": [
48
- {
49
- "name": "Patrick Arlt",
50
- "email": "parlt@esri.com",
51
- "url": "http://patrickarlt.com/"
52
- }
53
- ],
54
65
  "bugs": {
55
66
  "url": "https://github.com/Esri/arcgis-rest-js/issues"
56
67
  },
57
- "homepage": "https://github.com/Esri/arcgis-rest-js#readme",
58
- "keywords": [
59
- "typescript",
60
- "promise",
61
- "fetch",
62
- "arcgis",
63
- "esri",
64
- "ES6"
65
- ]
68
+ "publishConfig": {
69
+ "access": "public"
70
+ },
71
+ "esri": {
72
+ "keyExports": [
73
+ "bulkGeocode",
74
+ "geocode",
75
+ "getGeocodeService",
76
+ "reverseGeocode",
77
+ "suggest"
78
+ ]
79
+ }
66
80
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk.js","sourceRoot":"","sources":["../../src/bulk.ts"],"names":[],"mappings":";AAAA;gBACgB;;;;AAEhB,iEAA8D;AAG9D,qCAA+E;AAqC/E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,WAAW,CACzB,cAAmC,CAAC,kCAAkC;;IAEtE,IAAM,OAAO,sBACX,QAAQ,EAAE,0CAAgC,EAC1C,MAAM,EAAE,EAAE,IACP,cAAc,CAClB,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG;QACzB,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,UAAA,OAAO;YAC3C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;QACjC,CAAC,CAAC;KACH,CAAC;IAEF,sDAAsD;IACtD,IACE,CAAC,cAAc,CAAC,cAAc;QAC9B,OAAO,CAAC,QAAQ,KAAK,0CAAgC,EACrD;QACA,OAAO,OAAO,CAAC,MAAM,CACnB,iEAAiE,CAClE,CAAC;KACH;IAED,OAAO,6BAAO,CACT,8B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AAA,2BAA2B,GACtC,0EAA0E,CAAC;AAChE,QAAA,gCAAgC,GAC3C,sEAAsE,CAAC;AAkBzE;;;;;;;;;;;;;;GAcG;AACH,SAAgB,iBAAiB,CAC/B,cAAiC;IAEjC,IAAM,GAAG,GACP,CAAC,cAAc,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,mCAA2B,CAAC;IAE7E,IAAM,OAAO,sBACX,UAAU,EAAE,KAAK,EACjB,YAAY,EAAE,IAAI,IACf,cAAc,CAClB,CAAC;IAEF,OAAO,6BAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC/B,CAAC;AAbD,8CAaC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- /* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
3
- * Apache-2.0 */
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- var tslib_1 = require("tslib");
6
- tslib_1.__exportStar(require("./geocode"), exports);
7
- tslib_1.__exportStar(require("./suggest"), exports);
8
- tslib_1.__exportStar(require("./reverse"), exports);
9
- tslib_1.__exportStar(require("./bulk"), exports);
10
- tslib_1.__exportStar(require("./helpers"), exports);
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;gBACgB;;;AAEhB,oDAA0B;AAC1B,oDAA0B;AAC1B,oDAA0B;AAC1B,iDAAuB;AACvB,oDAA0B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"reverse.js","sourceRoot":"","sources":["../../src/reverse.ts"],"names":[],"mappings":";AAAA;gBACgB;;;;AAEhB,iEAA8D;AAI9D,qCAA0E;AAS1E,SAAS,eAAe,CACtB,MAAwE;IAExE,OAAO,CACJ,MAA2B,CAAC,MAAM,KAAK,CAAC;QACxC,MAAmC,CAAC,MAAM,KAAK,CAAC,CAClD,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CACjB,MAAwE;IAExE,OAAO,CACJ,MAAo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