@azure-rest/maps-render 1.0.0-beta.3 → 2.0.0-alpha.20240926.2

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 (32) hide show
  1. package/README.md +38 -33
  2. package/dist/index.js +24 -28
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/createMultiCollection.js +1 -1
  5. package/dist-esm/src/createMultiCollection.js.map +1 -1
  6. package/dist-esm/src/createPathQuery.js +2 -2
  7. package/dist-esm/src/createPathQuery.js.map +1 -1
  8. package/dist-esm/src/createPinsQuery.js +1 -1
  9. package/dist-esm/src/createPinsQuery.js.map +1 -1
  10. package/dist-esm/src/generated/clientDefinitions.js +1 -1
  11. package/dist-esm/src/generated/clientDefinitions.js.map +1 -1
  12. package/dist-esm/src/generated/index.js +1 -1
  13. package/dist-esm/src/generated/index.js.map +1 -1
  14. package/dist-esm/src/generated/isUnexpected.js +6 -5
  15. package/dist-esm/src/generated/isUnexpected.js.map +1 -1
  16. package/dist-esm/src/generated/mapsRenderClient.js +9 -14
  17. package/dist-esm/src/generated/mapsRenderClient.js.map +1 -1
  18. package/dist-esm/src/generated/outputModels.js +1 -1
  19. package/dist-esm/src/generated/outputModels.js.map +1 -1
  20. package/dist-esm/src/generated/parameters.js +1 -1
  21. package/dist-esm/src/generated/parameters.js.map +1 -1
  22. package/dist-esm/src/generated/responses.js +1 -1
  23. package/dist-esm/src/generated/responses.js.map +1 -1
  24. package/dist-esm/src/index.js +1 -1
  25. package/dist-esm/src/index.js.map +1 -1
  26. package/dist-esm/src/mapsRender.js +3 -3
  27. package/dist-esm/src/mapsRender.js.map +1 -1
  28. package/dist-esm/src/positionToTileXY.js +1 -1
  29. package/dist-esm/src/positionToTileXY.js.map +1 -1
  30. package/package.json +32 -31
  31. package/review/maps-render.api.md +3 -3
  32. package/types/maps-render-rest.d.ts +174 -211
package/README.md CHANGED
@@ -11,6 +11,11 @@ Key links:
11
11
  - [API reference documentation][api_ref]
12
12
  - [Product Information][product_info]
13
13
 
14
+ | Package Version | Service Version |
15
+ |-----------------|-----------------|
16
+ | ^1.0.0-beta.4 | V1 |
17
+ | ^2.0.0-beta.1 | 2024-04-01 |
18
+
14
19
  ## Getting started
15
20
 
16
21
  ### Currently supported environments
@@ -39,21 +44,21 @@ npm install @azure-rest/maps-render
39
44
 
40
45
  ### Create and authenticate a `MapsRenderClient`
41
46
 
42
- You'll need a `credential` instance for authentication when creating the `MapsRenderClient` instance used to access the Azure Maps render APIs. You can use either an Azure Active Directory (Azure AD) credential or an Azure subscription key to authenticate. For more information on authentication, see [Authentication with Azure Maps][az_map_auth].
47
+ You'll need a `credential` instance for authentication when creating the `MapsRenderClient` instance used to access the Azure Maps render APIs. You can use either a Microsoft Entra ID credential or an Azure subscription key to authenticate. For more information on authentication, see [Authentication with Azure Maps][az_map_auth].
43
48
 
44
- #### Using an Azure AD credential
49
+ #### Using an Microsoft Entra ID credential
45
50
 
46
- To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
51
+ To use an [Microsoft Entra ID token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
47
52
  provide an instance of the desired credential type obtained from the
48
53
  [@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.
49
54
 
50
- To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
55
+ To authenticate with Microsoft Entra ID, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
51
56
 
52
57
  After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
53
58
  As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
54
59
  can be used to authenticate the client.
55
60
 
56
- You'll need to register the new Azure AD application and grant access to Azure Maps by assigning the required role to your service principal. For more information, see [Host a daemon on non-Azure resources](https://learn.microsoft.com/azure/azure-maps/how-to-secure-daemon-app#host-a-daemon-on-non-azure-resources). Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
61
+ You'll need to register the new Microsoft Entra ID application and grant access to Azure Maps by assigning the required role to your service principal. For more information, see [Host a daemon on non-Azure resources](https://learn.microsoft.com/azure/azure-maps/how-to-secure-daemon-app#host-a-daemon-on-non-azure-resources). Set the values of the client ID, tenant ID, and client secret of the Microsoft Entra ID application as environment variables:
57
62
  `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
58
63
 
59
64
  You will also need to specify the Azure Maps resource you intend to use by specifying the `clientId` in the client options.
@@ -100,33 +105,33 @@ npm install @azure/core-auth
100
105
  Finally, you can use the SAS token to authenticate the client:
101
106
 
102
107
  ```javascript
103
- const MapsRender = require("@azure-rest/maps-render").default;
104
- const { AzureSASCredential } = require("@azure/core-auth");
105
- const { DefaultAzureCredential } = require("@azure/identity");
106
- const { AzureMapsManagementClient } = require("@azure/arm-maps");
107
-
108
- const subscriptionId = "<subscription ID of the map account>"
109
- const resourceGroupName = "<resource group name of the map account>";
110
- const accountName = "<name of the map account>";
111
- const mapsAccountSasParameters = {
112
- start: "<start time in ISO format>", // e.g. "2023-11-24T03:51:53.161Z"
113
- expiry: "<expiry time in ISO format>", // maximum value to start + 1 day
114
- maxRatePerSecond: 500,
115
- principalId: "<principle ID (object ID) of the managed identity>",
116
- signingKey: "primaryKey",
117
- };
118
- const credential = new DefaultAzureCredential();
119
- const managementClient = new AzureMapsManagementClient(credential, subscriptionId);
120
- const {accountSasToken} = await managementClient.accounts.listSas(
121
- resourceGroupName,
122
- accountName,
123
- mapsAccountSasParameters
124
- );
125
- if (accountSasToken === undefined) {
126
- throw new Error("No accountSasToken was found for the Maps Account.");
127
- }
128
- const sasCredential = new AzureSASCredential(accountSasToken);
129
- const client = MapsRender(sasCredential);
108
+ const MapsRender = require("@azure-rest/maps-render").default;
109
+ const { AzureSASCredential } = require("@azure/core-auth");
110
+ const { DefaultAzureCredential } = require("@azure/identity");
111
+ const { AzureMapsManagementClient } = require("@azure/arm-maps");
112
+
113
+ const subscriptionId = "<subscription ID of the map account>";
114
+ const resourceGroupName = "<resource group name of the map account>";
115
+ const accountName = "<name of the map account>";
116
+ const mapsAccountSasParameters = {
117
+ start: "<start time in ISO format>", // e.g. "2023-11-24T03:51:53.161Z"
118
+ expiry: "<expiry time in ISO format>", // maximum value to start + 1 day
119
+ maxRatePerSecond: 500,
120
+ principalId: "<principle ID (object ID) of the managed identity>",
121
+ signingKey: "primaryKey",
122
+ };
123
+ const credential = new DefaultAzureCredential();
124
+ const managementClient = new AzureMapsManagementClient(credential, subscriptionId);
125
+ const { accountSasToken } = await managementClient.accounts.listSas(
126
+ resourceGroupName,
127
+ accountName,
128
+ mapsAccountSasParameters,
129
+ );
130
+ if (accountSasToken === undefined) {
131
+ throw new Error("No accountSasToken was found for the Maps Account.");
132
+ }
133
+ const sasCredential = new AzureSASCredential(accountSasToken);
134
+ const client = MapsRender(sasCredential);
130
135
  ```
131
136
 
132
137
  ## Key concepts
@@ -221,7 +226,7 @@ console.log("The metadata of Microsoft Base tileset: ");
221
226
  const { maxzoom, minzoom, bounds = [] } = response.body;
222
227
  console.log(`The zoom range started from ${minzoom} to ${maxzoom}`);
223
228
  console.log(
224
- `The left bound is ${bounds[0]}, bottom bound is ${bounds[1]}, right bound is ${bounds[2]}, and top bound is ${bounds[3]}`
229
+ `The left bound is ${bounds[0]}, bottom bound is ${bounds[1]}, right bound is ${bounds[2]}, and top bound is ${bounds[3]}`,
225
230
  );
226
231
  ```
227
232
 
package/dist/index.js CHANGED
@@ -8,40 +8,35 @@ var mapsCommon = require('@azure/maps-common');
8
8
  var coreClient = require('@azure-rest/core-client');
9
9
 
10
10
  // Copyright (c) Microsoft Corporation.
11
- // Licensed under the MIT license.
11
+ // Licensed under the MIT License.
12
12
  /**
13
13
  * Initialize a new instance of the class MapsRenderClient class.
14
14
  * @param credentials type: KeyCredential
15
15
  */
16
16
  function createClient(credentials, options = {}) {
17
- const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;
18
- options.apiVersion = options.apiVersion ?? "2022-08-01";
19
- options = {
20
- ...options,
21
- credentials: {
17
+ var _a, _b;
18
+ const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `https://atlas.microsoft.com`;
19
+ options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2024-04-01";
20
+ options = Object.assign(Object.assign({}, options), { credentials: {
22
21
  apiKeyHeaderName: "subscription-key"
23
- }
24
- };
25
- const userAgentInfo = `azsdk-js-maps-render-rest/1.0.0-beta.2`;
22
+ } });
23
+ const userAgentInfo = `azsdk-js-maps-render-rest/2.0.0-beta.1`;
26
24
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
27
25
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
28
26
  : `${userAgentInfo}`;
29
- options = {
30
- ...options,
31
- userAgentOptions: {
27
+ options = Object.assign(Object.assign({}, options), { userAgentOptions: {
32
28
  userAgentPrefix
33
- }
34
- };
29
+ } });
35
30
  const client = coreClient.getClient(baseUrl, credentials, options);
36
31
  return client;
37
32
  }
38
33
 
39
34
  // Copyright (c) Microsoft Corporation.
40
- // Licensed under the MIT license.
35
+ // Licensed under the MIT License.
41
36
  function MapsRender(credential, clientIdOrOptions = {}, maybeOptions = {}) {
42
37
  const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
43
38
  /**
44
- * maps service requires a header "ms-x-client-id", which is different from the standard AAD.
39
+ * maps service requires a header "ms-x-client-id", which is different from the standard Microsoft Entra ID.
45
40
  * So we need to do our own implementation.
46
41
  * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication
47
42
  */
@@ -53,7 +48,7 @@ function MapsRender(credential, clientIdOrOptions = {}, maybeOptions = {}) {
53
48
  const client = createClient(undefined, options);
54
49
  client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
55
50
  credential,
56
- scopes: `${options.baseUrl || "https://atlas.microsoft.com"}/.default`,
51
+ scopes: "https://atlas.microsoft.com/.default",
57
52
  }));
58
53
  client.pipeline.addPolicy(mapsCommon.createMapsClientIdPolicy(clientId));
59
54
  return client;
@@ -73,21 +68,21 @@ function MapsRender(credential, clientIdOrOptions = {}, maybeOptions = {}) {
73
68
  }
74
69
 
75
70
  // Copyright (c) Microsoft Corporation.
76
- // Licensed under the MIT license.
71
+ // Licensed under the MIT License.
77
72
  const responseMap = {
78
73
  "GET /map/tile": ["200"],
79
74
  "GET /map/tileset": ["200"],
80
75
  "GET /map/attribution": ["200"],
81
76
  "GET /map/statetile": ["200"],
82
77
  "GET /map/copyright/caption/{format}": ["200"],
83
- "GET /map/static/{format}": ["200"],
78
+ "GET /map/static": ["200"],
84
79
  "GET /map/copyright/bounding/{format}": ["200"],
85
80
  "GET /map/copyright/tile/{format}": ["200"],
86
81
  "GET /map/copyright/world/{format}": ["200"]
87
82
  };
88
83
  function isUnexpected(response) {
89
84
  const lroOriginal = response.headers["x-ms-original-url"];
90
- const url = new URL(lroOriginal ?? response.request.url);
85
+ const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
91
86
  const method = response.request.method;
92
87
  let pathDetails = responseMap[`${method} ${url.pathname}`];
93
88
  if (!pathDetails) {
@@ -96,6 +91,7 @@ function isUnexpected(response) {
96
91
  return !pathDetails.includes(response.status);
97
92
  }
98
93
  function geParametrizedPathSuccess(method, path) {
94
+ var _a, _b;
99
95
  const pathParts = path.split("/");
100
96
  // Iterate the responseMap to find a match
101
97
  for (const [key, value] of Object.entries(responseMap)) {
@@ -114,8 +110,8 @@ function geParametrizedPathSuccess(method, path) {
114
110
  // track if we have found a match to return the values found.
115
111
  let found = true;
116
112
  for (let i = 0; i < candidateParts.length; i++) {
117
- if (candidateParts[i]?.startsWith("{") &&
118
- candidateParts[i]?.endsWith("}")) {
113
+ if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
114
+ ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.endsWith("}"))) {
119
115
  // If the current part of the candidate is a "template" part
120
116
  // it is a match with the actual path part on hand
121
117
  // skip as the parameterized part can match anything
@@ -149,7 +145,7 @@ function getPathFromMapKey(mapKey) {
149
145
  }
150
146
 
151
147
  // Copyright (c) Microsoft Corporation.
152
- // Licensed under the MIT license.
148
+ // Licensed under the MIT License.
153
149
  function clip(n, minValue, maxValue) {
154
150
  return Math.min(Math.max(n, minValue), maxValue);
155
151
  }
@@ -193,7 +189,7 @@ function positionToTileXY(position, zoom, tileSize) {
193
189
  }
194
190
 
195
191
  // Copyright (c) Microsoft Corporation.
196
- // Licensed under the MIT license.
192
+ // Licensed under the MIT License.
197
193
  /**
198
194
  * @internal
199
195
  * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).
@@ -206,7 +202,7 @@ function createMultiCollection(key, values) {
206
202
  }
207
203
 
208
204
  // Copyright (c) Microsoft Corporation.
209
- // Licensed under the MIT license.
205
+ // Licensed under the MIT License.
210
206
  const optionKeyMap$1 = {
211
207
  opacity: "al",
212
208
  labelAnchor: "la",
@@ -279,7 +275,7 @@ function createPinsQuery(pinSets) {
279
275
  }
280
276
 
281
277
  // Copyright (c) Microsoft Corporation.
282
- // Licensed under the MIT license.
278
+ // Licensed under the MIT License.
283
279
  function isCircularPath(path) {
284
280
  return "center" in path;
285
281
  }
@@ -367,7 +363,7 @@ function createPathQuery(paths) {
367
363
  const pathQueries = paths.map((path) => {
368
364
  if (isCircularPath(path)) {
369
365
  const { center, radiusInMeters, options } = path;
370
- return comosePathVal([center], { ...options, radius: radiusInMeters });
366
+ return comosePathVal([center], Object.assign(Object.assign({}, options), { radius: radiusInMeters }));
371
367
  }
372
368
  return comosePathVal(path.coordinates, path.options || {});
373
369
  });
@@ -375,7 +371,7 @@ function createPathQuery(paths) {
375
371
  }
376
372
 
377
373
  // Copyright (c) Microsoft Corporation.
378
- // Licensed under the MIT license.
374
+ // Licensed under the MIT License.
379
375
 
380
376
  exports.createPathQuery = createPathQuery;
381
377
  exports.createPinsQuery = createPinsQuery;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/generated/mapsRenderClient.ts","../src/mapsRender.ts","../src/generated/isUnexpected.ts","../src/positionToTileXY.ts","../src/createMultiCollection.ts","../src/createPinsQuery.ts","../src/createPathQuery.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsRenderClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class MapsRenderClient class.\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n credentials: KeyCredential,\n options: ClientOptions = {}\n): MapsRenderClient {\n const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;\n options.apiVersion = options.apiVersion ?? \"2022-08-01\";\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"subscription-key\"\n }\n };\n\n const userAgentInfo = `azsdk-js-maps-render-rest/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix\n }\n };\n\n const client = getClient(baseUrl, credentials, options) as MapsRenderClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport {\n AzureKeyCredential,\n AzureSASCredential,\n isSASCredential,\n isTokenCredential,\n TokenCredential,\n} from \"@azure/core-auth\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport { MapsRenderClient } from \"./generated\";\nimport createClient from \"./generated/mapsRenderClient\";\n\n/**\n * Creates an instance of MapsRenderClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-Render\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsRender(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsRenderClient from \"@azure-rest/maps-render\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRender(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-render\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsRender(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsRenderClient;\nexport default function MapsRender(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsRenderClient {\n const options = typeof clientIdOrOptions === \"string\" ? maybeOptions : clientIdOrOptions;\n\n /**\n * maps service requires a header \"ms-x-client-id\", which is different from the standard AAD.\n * So we need to do our own implementation.\n * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication\n */\n if (isTokenCredential(credential)) {\n const clientId = typeof clientIdOrOptions === \"string\" ? clientIdOrOptions : \"\";\n if (!clientId) {\n throw Error(\"Client id is needed for TokenCredential\");\n }\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: `${options.baseUrl || \"https://atlas.microsoft.com\"}/.default`,\n }),\n );\n client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));\n return client;\n }\n\n if (isSASCredential(credential)) {\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy({\n name: \"mapsSASCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", `jwt-sas ${credential.signature}`);\n return next(request);\n },\n });\n return client;\n }\n\n return createClient(credential, options);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n RenderGetMapTile200Response,\n RenderGetMapTileDefaultResponse,\n RenderGetMapTileset200Response,\n RenderGetMapTilesetDefaultResponse,\n RenderGetMapAttribution200Response,\n RenderGetMapAttributionDefaultResponse,\n RenderGetMapStateTile200Response,\n RenderGetMapStateTileDefaultResponse,\n RenderGetCopyrightCaption200Response,\n RenderGetCopyrightCaptionDefaultResponse,\n RenderGetMapStaticImage200Response,\n RenderGetMapStaticImageDefaultResponse,\n RenderGetCopyrightFromBoundingBox200Response,\n RenderGetCopyrightFromBoundingBoxDefaultResponse,\n RenderGetCopyrightForTile200Response,\n RenderGetCopyrightForTileDefaultResponse,\n RenderGetCopyrightForWorld200Response,\n RenderGetCopyrightForWorldDefaultResponse\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /map/tile\": [\"200\"],\n \"GET /map/tileset\": [\"200\"],\n \"GET /map/attribution\": [\"200\"],\n \"GET /map/statetile\": [\"200\"],\n \"GET /map/copyright/caption/{format}\": [\"200\"],\n \"GET /map/static/{format}\": [\"200\"],\n \"GET /map/copyright/bounding/{format}\": [\"200\"],\n \"GET /map/copyright/tile/{format}\": [\"200\"],\n \"GET /map/copyright/world/{format}\": [\"200\"]\n};\n\nexport function isUnexpected(\n response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse\n): response is RenderGetMapTileDefaultResponse;\nexport function isUnexpected(\n response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse\n): response is RenderGetMapTilesetDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse\n): response is RenderGetMapAttributionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse\n): response is RenderGetMapStateTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n): response is RenderGetCopyrightCaptionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse\n): response is RenderGetMapStaticImageDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n): response is RenderGetCopyrightFromBoundingBoxDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n): response is RenderGetCopyrightForTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n): response is RenderGetCopyrightForWorldDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapTile200Response\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTileset200Response\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n): response is\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorldDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = geParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (\n candidateParts.length === pathParts.length &&\n hasParametrizedPath(key)\n ) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.endsWith(\"}\")\n ) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LatLon } from \"@azure/maps-common\";\n\nfunction clip(n: number, minValue: number, maxValue: number): number {\n return Math.min(Math.max(n, minValue), maxValue);\n}\n\nconst MIN_LATITUDE = -85.05112878;\nconst MAX_LATITUDE = 85.05112878;\nconst MIN_LONGITUDE = -180;\nconst MAX_LONGITUDE = 180;\n/**\n * Calculates the XY tile coordinates that a coordinate falls into for a specific zoom level.\n * Reference: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code\n *\n * @example\n * ```ts\n * const zoom = 6;\n * const { x, y } = positionToTileXY([47.61559, -122.33817], 6, \"256\");\n * const response = await client\n * .path(\"/map/tile\")\n * .get({\n * queryParameters: { tilesetId: \"microsoft.base.road\", zoom, x, y },\n * })\n * ```\n *\n * @param position - Position coordinate in the format [latitude, longitude].\n * @param zoom - Zoom level.\n * @param tileSize - The size of the tiles in the tile pyramid.\n * @returns Tile XY coordinates.\n */\nexport function positionToTileXY(\n position: LatLon,\n zoom: number,\n tileSize: \"512\" | \"256\",\n): { x: number; y: number } {\n const latitude = clip(position[0], MIN_LATITUDE, MAX_LATITUDE);\n const longitude = clip(position[1], MIN_LONGITUDE, MAX_LONGITUDE);\n\n const x = (longitude + 180) / 360;\n const sinLatitude = Math.sin((latitude * Math.PI) / 180);\n const y = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);\n\n const tileSizeInNum = parseInt(tileSize);\n // tileSize needed in calculations as in rare cases the multiplying/rounding/dividing can make the difference of a pixel which can result in a completely different tile.\n const mapSize = Math.ceil(tileSizeInNum * Math.pow(2, zoom));\n\n return {\n x: Math.floor(clip(x * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),\n y: Math.floor(clip(y * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * @internal\n * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).\n * This should be removed once the core-client support collectionFormat: multi.\n */\nexport function createMultiCollection(key: string, values: string[]): string {\n return values.slice(1).reduce((acc, value) => {\n return `${acc}&${key}=${value}`;\n }, values[0] || \"\");\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * Specify how the pin's position and label text.\n */\nexport interface Pin {\n /** The coordinate of the pin. */\n coordinate: LatLon;\n /** The label text for the pin. */\n label?: string;\n}\n\n/**\n * The pin options for default/none image style..\n */\nexport interface PinOptions {\n /** The opacity of the pin. Range from 0 to 1 */\n opacity?: number;\n /**\n * The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and is at the top center of custom pushpins (see below).\n * To override the label anchor, using the _labelAnchor_ option and provide X and Y pixel coordinates for the anchor.\n * These coordinates are relative to the top left corner of the pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down.\n * For example, to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image, use \\{labelAnchor: [10, -4]\\}\n * */\n labelAnchor?: [number, number];\n /** Color of the label. Range from 000000 to FFFFFF */\n labelColor?: string;\n /** Size of the label in pixels. */\n labelSizeInPixels?: number;\n /**\n * By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures the location that you're trying to highlight.\n * To override the anchor location of the pin image, use the _pinAnchor_ option. This uses the same format as the _labelAnchor_ options.\n * For example, if your custom pin image has the tip of the pin at the top left corner of the image, you can set the anchor to that spot by using \\{pinAnchor: [0, 0]\\}\n */\n pinAnchor?: [number, number];\n /** The ration of the pin. Range from -360 to 360*/\n rotationInDegree?: number;\n /** The scale of the pin. Should be greater than 0. */\n scale?: number;\n /** Color of the pin. Range from 000000 to FFFFFF */\n pinColor?: string;\n}\n\nconst optionKeyMap: Record<keyof PinOptions, string> = {\n opacity: \"al\",\n labelAnchor: \"la\",\n labelColor: \"lc\",\n labelSizeInPixels: \"ls\",\n pinAnchor: \"an\",\n rotationInDegree: \"ro\",\n scale: \"sc\",\n pinColor: \"co\",\n};\n\nfunction isOptionKeyMap(key: any): key is keyof PinOptions {\n return key in optionKeyMap;\n}\n\nexport interface PinSet {\n pins: Pin[];\n pinImage?: \"default\" | \"none\" | string;\n options?: PinOptions;\n}\n/**\n * Create a pin query string for _get map static image_\n *\n * @example\n * ```ts\n *\n * const pins = {\n * pins: [\n * { coordinate: [52.577, 13.35], label: \"Label start\" },\n * { coordinate: [52.6, 13.2988], label: \"Label end\" },\n * ],\n * pinImage: \"<image source url || default || none>\"\n * options: {\n * scale: 0.9,\n * pinColor: \"FF0000\",\n * labelColor: \"0000FF\",\n * labelSizeInPixels: 18,\n * }\n * );\n * const res = await client\n * .path(\"/map/static/{format}\", \"png\")\n * .get({\n * queryParameters: {\n * bbox: [13.228, 52.4559, 13.5794, 52.62],\n * zoom: 10,\n * pins: pins,\n * },\n * skipUrlEncoding: true,\n * })\n * ```\n *\n * @param pins - An array of {@link Pin} that specify the positions and label text of each pin.\n * @param pinImage - Specify the image source for custom pin. Set this to \"none\" if you don't want to show a pin image.\n * @param options - The style options of the pins. See {@link PinOptions}\n * @returns - The composed query string.\n */\n\nexport function createPinsQuery(pinSets: PinSet[]): string {\n const pinsQueries = pinSets.map(({ pins, pinImage = \"default\", options = {} }) => {\n // compose the pins' position query string\n const pinsQueryStr = pins\n .map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : \"\"}${lon} ${lat}`)\n .join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKeyMap(key)) throw Error(`Unexpected option: ${key}`);\n if (Array.isArray(val)) return (queryStr += `|${optionKeyMap[key]}${val[0]} ${val[1]}`);\n return (queryStr += `|${optionKeyMap[key]}${val}`);\n }, \"\");\n if (pinImage === \"none\" || pinImage === \"default\") {\n return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;\n }\n return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;\n });\n return createMultiCollection(\"pins\", pinsQueries);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * The options that modify the style of a circular path.\n */\nexport interface CircularPathOptions {\n /** The line color of the path. Range from 000000 to FFFFFF. */\n lineColor?: string;\n /** The line opacity of the path. Range from 0 to 1. */\n lineOpacity?: number;\n /** The line width of the line. Should be greater than 0. */\n lineWidthInPixels?: number;\n}\n\n/**\n * The options that modify the style of a polygonal path.\n */\nexport interface PolygonalPathOptions extends CircularPathOptions {\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 000000 to FFFFFF.*/\n fillColor?: string;\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 0 to 1.*/\n fillOpacity?: number;\n}\n\ninterface PathOptionsForRequest extends PolygonalPathOptions {\n radius?: number;\n}\n\n/**\n * Specify a circular path.\n */\nexport interface CircularPath {\n /** The center of the circular path. */\n center: LatLon;\n /** The radius of the circular path. */\n radiusInMeters: number;\n /** The options that modify the style of the circular path. */\n options?: CircularPathOptions;\n}\n\nfunction isCircularPath(path: PolygonalPath | CircularPath): path is CircularPath {\n return \"center\" in path;\n}\n/**\n * Specify a polygonal path.\n */\nexport interface PolygonalPath {\n /** The coordinates of the polygonal path. The identical coordinate in the first & last position construct a closed polygon.*/\n coordinates: LatLon[];\n /** The options that modify the style of the polygonal path. */\n options?: PolygonalPathOptions;\n}\n\nconst optionKeyMap: Record<keyof PathOptionsForRequest, string> = {\n lineColor: \"lc\",\n lineOpacity: \"la\",\n fillColor: \"fc\",\n fillOpacity: \"fa\",\n lineWidthInPixels: \"lw\",\n radius: \"ra\",\n};\n\nfunction isOptionKey(key: any): key is keyof PathOptionsForRequest {\n return key in optionKeyMap;\n}\n\nfunction comosePathVal(coordinates: LatLon[], options: PathOptionsForRequest): string {\n // compose the coordinates query string\n const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKey(key)) throw Error(`Unknown key ${key}`);\n queryStr += `${queryStr ? \"|\" : \"\"}${optionKeyMap[key]}${val}`;\n return queryStr;\n }, \"\");\n return optionsQueryStr + \"||\" + coordinatesQueryStr;\n}\n\n/**\n * Create a path query string for _get map static image_ request.\n *\n * @example\n * ```ts\n * const circularPath = {\n * center: [52.4559, 13.228],\n * radiusInMeters: 10000,\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const linearPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const polygonPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * [52.577, 13.35],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * fillColor: \"FFFFFF\",\n * fillOpacity: 0.8,\n * },\n * };\n *\n * const path = createPathQuery([circularPath, linearPath, polygonPath]);\n * // Send the request\n * const response = await client.path(\"/map/static/{format}\", \"png\").get({\n * queryParameters: {\n * bbox: [13.228,52.4559,13.5794,52.629],\n * path: path\n * }\n * });\n * ```\n *\n * @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.\n * @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.\n */\nexport function createPathQuery(paths: Array<PolygonalPath | CircularPath>): string {\n const pathQueries = paths.map((path) => {\n if (isCircularPath(path)) {\n const { center, radiusInMeters, options } = path;\n return comosePathVal([center], { ...options, radius: radiusInMeters });\n }\n return comosePathVal(path.coordinates, path.options || {});\n });\n return createMultiCollection(\"path\", pathQueries);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport MapsRender from \"./mapsRender\";\n\nexport * from \"./generated\";\nexport * from \"./positionToTileXY\";\nexport * from \"./createPinsQuery\";\nexport * from \"./createPathQuery\";\nexport default MapsRender;\n"],"names":["getClient","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsClientIdPolicy","isSASCredential","optionKeyMap"],"mappings":";;;;;;;;;AAAA;AACA;AAMA;;;AAGG;AACqB,SAAA,YAAY,CAClC,WAA0B,EAC1B,UAAyB,EAAE,EAAA;AAE3B,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;IACjE,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;AACxD,IAAA,OAAO,GAAG;AACR,QAAA,GAAG,OAAO;AACV,QAAA,WAAW,EAAE;AACX,YAAA,gBAAgB,EAAE,kBAAkB;AACrC,SAAA;KACF,CAAC;IAEF,MAAM,aAAa,GAAG,C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{"version":3,"file":"index.js","sources":["../src/generated/mapsRenderClient.ts","../src/mapsRender.ts","../src/generated/isUnexpected.ts","../src/positionToTileXY.ts","../src/createMultiCollection.ts","../src/createPinsQuery.ts","../src/createPathQuery.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsRenderClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class MapsRenderClient class.\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n credentials: KeyCredential,\n options: ClientOptions = {}\n): MapsRenderClient {\n const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;\n options.apiVersion = options.apiVersion ?? \"2024-04-01\";\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"subscription-key\"\n }\n };\n\n const userAgentInfo = `azsdk-js-maps-render-rest/2.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix\n }\n };\n\n const client = getClient(baseUrl, credentials, options) as MapsRenderClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport {\n AzureKeyCredential,\n AzureSASCredential,\n isSASCredential,\n isTokenCredential,\n TokenCredential,\n} from \"@azure/core-auth\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport { MapsRenderClient } from \"./generated\";\nimport createClient from \"./generated/mapsRenderClient\";\n\n/**\n * Creates an instance of MapsRenderClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-Render\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsRender(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsRenderClient from \"@azure-rest/maps-render\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRender(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsRenderClient;\n/**\n * Creates an instance of MapsRender from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsRender from \"@azure-rest/maps-render\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsRender(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Render Client\n */\nexport default function MapsRender(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsRenderClient;\nexport default function MapsRender(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsRenderClient {\n const options = typeof clientIdOrOptions === \"string\" ? maybeOptions : clientIdOrOptions;\n\n /**\n * maps service requires a header \"ms-x-client-id\", which is different from the standard Microsoft Entra ID.\n * So we need to do our own implementation.\n * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication\n */\n if (isTokenCredential(credential)) {\n const clientId = typeof clientIdOrOptions === \"string\" ? clientIdOrOptions : \"\";\n if (!clientId) {\n throw Error(\"Client id is needed for TokenCredential\");\n }\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: \"https://atlas.microsoft.com/.default\",\n }),\n );\n client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));\n return client;\n }\n\n if (isSASCredential(credential)) {\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy({\n name: \"mapsSASCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", `jwt-sas ${credential.signature}`);\n return next(request);\n },\n });\n return client;\n }\n\n return createClient(credential, options);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n RenderGetMapTile200Response,\n RenderGetMapTileDefaultResponse,\n RenderGetMapTileset200Response,\n RenderGetMapTilesetDefaultResponse,\n RenderGetMapAttribution200Response,\n RenderGetMapAttributionDefaultResponse,\n RenderGetMapStateTile200Response,\n RenderGetMapStateTileDefaultResponse,\n RenderGetCopyrightCaption200Response,\n RenderGetCopyrightCaptionDefaultResponse,\n RenderGetMapStaticImage200Response,\n RenderGetMapStaticImageDefaultResponse,\n RenderGetCopyrightFromBoundingBox200Response,\n RenderGetCopyrightFromBoundingBoxDefaultResponse,\n RenderGetCopyrightForTile200Response,\n RenderGetCopyrightForTileDefaultResponse,\n RenderGetCopyrightForWorld200Response,\n RenderGetCopyrightForWorldDefaultResponse\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /map/tile\": [\"200\"],\n \"GET /map/tileset\": [\"200\"],\n \"GET /map/attribution\": [\"200\"],\n \"GET /map/statetile\": [\"200\"],\n \"GET /map/copyright/caption/{format}\": [\"200\"],\n \"GET /map/static\": [\"200\"],\n \"GET /map/copyright/bounding/{format}\": [\"200\"],\n \"GET /map/copyright/tile/{format}\": [\"200\"],\n \"GET /map/copyright/world/{format}\": [\"200\"]\n};\n\nexport function isUnexpected(\n response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse\n): response is RenderGetMapTileDefaultResponse;\nexport function isUnexpected(\n response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse\n): response is RenderGetMapTilesetDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse\n): response is RenderGetMapAttributionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse\n): response is RenderGetMapStateTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n): response is RenderGetCopyrightCaptionDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse\n): response is RenderGetMapStaticImageDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n): response is RenderGetCopyrightFromBoundingBoxDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n): response is RenderGetCopyrightForTileDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n): response is RenderGetCopyrightForWorldDefaultResponse;\nexport function isUnexpected(\n response:\n | RenderGetMapTile200Response\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTileset200Response\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttribution200Response\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTile200Response\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImage200Response\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n): response is\n | RenderGetMapTileDefaultResponse\n | RenderGetMapTilesetDefaultResponse\n | RenderGetMapAttributionDefaultResponse\n | RenderGetMapStateTileDefaultResponse\n | RenderGetCopyrightCaptionDefaultResponse\n | RenderGetMapStaticImageDefaultResponse\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n | RenderGetCopyrightForTileDefaultResponse\n | RenderGetCopyrightForWorldDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = geParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (\n candidateParts.length === pathParts.length &&\n hasParametrizedPath(key)\n ) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.endsWith(\"}\")\n ) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { LatLon } from \"@azure/maps-common\";\n\nfunction clip(n: number, minValue: number, maxValue: number): number {\n return Math.min(Math.max(n, minValue), maxValue);\n}\n\nconst MIN_LATITUDE = -85.05112878;\nconst MAX_LATITUDE = 85.05112878;\nconst MIN_LONGITUDE = -180;\nconst MAX_LONGITUDE = 180;\n/**\n * Calculates the XY tile coordinates that a coordinate falls into for a specific zoom level.\n * Reference: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code\n *\n * @example\n * ```ts\n * const zoom = 6;\n * const { x, y } = positionToTileXY([47.61559, -122.33817], 6, \"256\");\n * const response = await client\n * .path(\"/map/tile\")\n * .get({\n * queryParameters: { tilesetId: \"microsoft.base.road\", zoom, x, y },\n * })\n * ```\n *\n * @param position - Position coordinate in the format [latitude, longitude].\n * @param zoom - Zoom level.\n * @param tileSize - The size of the tiles in the tile pyramid.\n * @returns Tile XY coordinates.\n */\nexport function positionToTileXY(\n position: LatLon,\n zoom: number,\n tileSize: \"512\" | \"256\",\n): { x: number; y: number } {\n const latitude = clip(position[0], MIN_LATITUDE, MAX_LATITUDE);\n const longitude = clip(position[1], MIN_LONGITUDE, MAX_LONGITUDE);\n\n const x = (longitude + 180) / 360;\n const sinLatitude = Math.sin((latitude * Math.PI) / 180);\n const y = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);\n\n const tileSizeInNum = parseInt(tileSize);\n // tileSize needed in calculations as in rare cases the multiplying/rounding/dividing can make the difference of a pixel which can result in a completely different tile.\n const mapSize = Math.ceil(tileSizeInNum * Math.pow(2, zoom));\n\n return {\n x: Math.floor(clip(x * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),\n y: Math.floor(clip(y * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).\n * This should be removed once the core-client support collectionFormat: multi.\n */\nexport function createMultiCollection(key: string, values: string[]): string {\n return values.slice(1).reduce((acc, value) => {\n return `${acc}&${key}=${value}`;\n }, values[0] || \"\");\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * Specify how the pin's position and label text.\n */\nexport interface Pin {\n /** The coordinate of the pin. */\n coordinate: LatLon;\n /** The label text for the pin. */\n label?: string;\n}\n\n/**\n * The pin options for default/none image style..\n */\nexport interface PinOptions {\n /** The opacity of the pin. Range from 0 to 1 */\n opacity?: number;\n /**\n * The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and is at the top center of custom pushpins (see below).\n * To override the label anchor, using the _labelAnchor_ option and provide X and Y pixel coordinates for the anchor.\n * These coordinates are relative to the top left corner of the pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down.\n * For example, to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image, use \\{labelAnchor: [10, -4]\\}\n * */\n labelAnchor?: [number, number];\n /** Color of the label. Range from 000000 to FFFFFF */\n labelColor?: string;\n /** Size of the label in pixels. */\n labelSizeInPixels?: number;\n /**\n * By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures the location that you're trying to highlight.\n * To override the anchor location of the pin image, use the _pinAnchor_ option. This uses the same format as the _labelAnchor_ options.\n * For example, if your custom pin image has the tip of the pin at the top left corner of the image, you can set the anchor to that spot by using \\{pinAnchor: [0, 0]\\}\n */\n pinAnchor?: [number, number];\n /** The ration of the pin. Range from -360 to 360*/\n rotationInDegree?: number;\n /** The scale of the pin. Should be greater than 0. */\n scale?: number;\n /** Color of the pin. Range from 000000 to FFFFFF */\n pinColor?: string;\n}\n\nconst optionKeyMap: Record<keyof PinOptions, string> = {\n opacity: \"al\",\n labelAnchor: \"la\",\n labelColor: \"lc\",\n labelSizeInPixels: \"ls\",\n pinAnchor: \"an\",\n rotationInDegree: \"ro\",\n scale: \"sc\",\n pinColor: \"co\",\n};\n\nfunction isOptionKeyMap(key: any): key is keyof PinOptions {\n return key in optionKeyMap;\n}\n\nexport interface PinSet {\n pins: Pin[];\n pinImage?: \"default\" | \"none\" | string;\n options?: PinOptions;\n}\n/**\n * Create a pin query string for _get map static image_\n *\n * @example\n * ```ts\n *\n * const pins = {\n * pins: [\n * { coordinate: [52.577, 13.35], label: \"Label start\" },\n * { coordinate: [52.6, 13.2988], label: \"Label end\" },\n * ],\n * pinImage: \"<image source url || default || none>\"\n * options: {\n * scale: 0.9,\n * pinColor: \"FF0000\",\n * labelColor: \"0000FF\",\n * labelSizeInPixels: 18,\n * }\n * );\n * const res = await client\n * .path(\"/map/static/{format}\", \"png\")\n * .get({\n * queryParameters: {\n * bbox: [13.228, 52.4559, 13.5794, 52.62],\n * zoom: 10,\n * pins: pins,\n * },\n * skipUrlEncoding: true,\n * })\n * ```\n *\n * @param pins - An array of {@link Pin} that specify the positions and label text of each pin.\n * @param pinImage - Specify the image source for custom pin. Set this to \"none\" if you don't want to show a pin image.\n * @param options - The style options of the pins. See {@link PinOptions}\n * @returns - The composed query string.\n */\n\nexport function createPinsQuery(pinSets: PinSet[]): string {\n const pinsQueries = pinSets.map(({ pins, pinImage = \"default\", options = {} }) => {\n // compose the pins' position query string\n const pinsQueryStr = pins\n .map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : \"\"}${lon} ${lat}`)\n .join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKeyMap(key)) throw Error(`Unexpected option: ${key}`);\n if (Array.isArray(val)) return (queryStr += `|${optionKeyMap[key]}${val[0]} ${val[1]}`);\n return (queryStr += `|${optionKeyMap[key]}${val}`);\n }, \"\");\n if (pinImage === \"none\" || pinImage === \"default\") {\n return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;\n }\n return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;\n });\n return createMultiCollection(\"pins\", pinsQueries);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * The options that modify the style of a circular path.\n */\nexport interface CircularPathOptions {\n /** The line color of the path. Range from 000000 to FFFFFF. */\n lineColor?: string;\n /** The line opacity of the path. Range from 0 to 1. */\n lineOpacity?: number;\n /** The line width of the line. Should be greater than 0. */\n lineWidthInPixels?: number;\n}\n\n/**\n * The options that modify the style of a polygonal path.\n */\nexport interface PolygonalPathOptions extends CircularPathOptions {\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 000000 to FFFFFF.*/\n fillColor?: string;\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 0 to 1.*/\n fillOpacity?: number;\n}\n\ninterface PathOptionsForRequest extends PolygonalPathOptions {\n radius?: number;\n}\n\n/**\n * Specify a circular path.\n */\nexport interface CircularPath {\n /** The center of the circular path. */\n center: LatLon;\n /** The radius of the circular path. */\n radiusInMeters: number;\n /** The options that modify the style of the circular path. */\n options?: CircularPathOptions;\n}\n\nfunction isCircularPath(path: PolygonalPath | CircularPath): path is CircularPath {\n return \"center\" in path;\n}\n/**\n * Specify a polygonal path.\n */\nexport interface PolygonalPath {\n /** The coordinates of the polygonal path. The identical coordinate in the first & last position construct a closed polygon.*/\n coordinates: LatLon[];\n /** The options that modify the style of the polygonal path. */\n options?: PolygonalPathOptions;\n}\n\nconst optionKeyMap: Record<keyof PathOptionsForRequest, string> = {\n lineColor: \"lc\",\n lineOpacity: \"la\",\n fillColor: \"fc\",\n fillOpacity: \"fa\",\n lineWidthInPixels: \"lw\",\n radius: \"ra\",\n};\n\nfunction isOptionKey(key: any): key is keyof PathOptionsForRequest {\n return key in optionKeyMap;\n}\n\nfunction comosePathVal(coordinates: LatLon[], options: PathOptionsForRequest): string {\n // compose the coordinates query string\n const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKey(key)) throw Error(`Unknown key ${key}`);\n queryStr += `${queryStr ? \"|\" : \"\"}${optionKeyMap[key]}${val}`;\n return queryStr;\n }, \"\");\n return optionsQueryStr + \"||\" + coordinatesQueryStr;\n}\n\n/**\n * Create a path query string for _get map static image_ request.\n *\n * @example\n * ```ts\n * const circularPath = {\n * center: [52.4559, 13.228],\n * radiusInMeters: 10000,\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const linearPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const polygonPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * [52.577, 13.35],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * fillColor: \"FFFFFF\",\n * fillOpacity: 0.8,\n * },\n * };\n *\n * const path = createPathQuery([circularPath, linearPath, polygonPath]);\n * // Send the request\n * const response = await client.path(\"/map/static/{format}\", \"png\").get({\n * queryParameters: {\n * bbox: [13.228,52.4559,13.5794,52.629],\n * path: path\n * }\n * });\n * ```\n *\n * @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.\n * @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.\n */\nexport function createPathQuery(paths: Array<PolygonalPath | CircularPath>): string {\n const pathQueries = paths.map((path) => {\n if (isCircularPath(path)) {\n const { center, radiusInMeters, options } = path;\n return comosePathVal([center], { ...options, radius: radiusInMeters });\n }\n return comosePathVal(path.coordinates, path.options || {});\n });\n return createMultiCollection(\"path\", pathQueries);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsRender from \"./mapsRender\";\n\nexport * from \"./generated\";\nexport * from \"./positionToTileXY\";\nexport * from \"./createPinsQuery\";\nexport * from \"./createPathQuery\";\nexport default MapsRender;\n"],"names":["getClient","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsClientIdPolicy","isSASCredential","optionKeyMap"],"mappings":";;;;;;;;;AAAA;AACA;AAMA;;;AAGG;AACqB,SAAA,YAAY,CAClC,WAA0B,EAC1B,UAAyB,EAAE,EAAA;;IAE3B,MAAM,OAAO,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,6BAA6B,CAAC;IACjE,OAAO,CAAC,UAAU,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,YAAY,CAAC;AACxD,IAAA,OAAO,GACF,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,OAAO,CACV,EAAA,EAAA,WAAW,EAAE;AACX,YAAA,gBAAgB,EAAE,kBAAkB;AACrC,SAAA,EAAA,CACF,CAAC;IAEF,MAAM,aAAa,GAAG,CAAA,sCAAA,CAAwC,CAAC;IAC/D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;UAChE,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAI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,MAAM,EAAE,WAAW,CAAC,CAAC;AACpD;;ACpJA;AACA;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /**
4
4
  * @internal
5
5
  * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).
@@ -1 +1 @@
1
- {"version":3,"file":"createMultiCollection.js","sourceRoot":"","sources":["../../src/createMultiCollection.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW,EAAE,MAAgB;IACjE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC3C,OAAO,GAAG,GAAG,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC;IAClC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACtB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * @internal\n * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).\n * This should be removed once the core-client support collectionFormat: multi.\n */\nexport function createMultiCollection(key: string, values: string[]): string {\n return values.slice(1).reduce((acc, value) => {\n return `${acc}&${key}=${value}`;\n }, values[0] || \"\");\n}\n"]}
1
+ {"version":3,"file":"createMultiCollection.js","sourceRoot":"","sources":["../../src/createMultiCollection.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW,EAAE,MAAgB;IACjE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC3C,OAAO,GAAG,GAAG,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC;IAClC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACtB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).\n * This should be removed once the core-client support collectionFormat: multi.\n */\nexport function createMultiCollection(key: string, values: string[]): string {\n return values.slice(1).reduce((acc, value) => {\n return `${acc}&${key}=${value}`;\n }, values[0] || \"\");\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createMultiCollection } from "./createMultiCollection";
4
4
  function isCircularPath(path) {
5
5
  return "center" in path;
@@ -88,7 +88,7 @@ export function createPathQuery(paths) {
88
88
  const pathQueries = paths.map((path) => {
89
89
  if (isCircularPath(path)) {
90
90
  const { center, radiusInMeters, options } = path;
91
- return comosePathVal([center], { ...options, radius: radiusInMeters });
91
+ return comosePathVal([center], Object.assign(Object.assign({}, options), { radius: radiusInMeters }));
92
92
  }
93
93
  return comosePathVal(path.coordinates, path.options || {});
94
94
  });
@@ -1 +1 @@
1
- {"version":3,"file":"createPathQuery.js","sourceRoot":"","sources":["../../src/createPathQuery.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAwChE,SAAS,cAAc,CAAC,IAAkC;IACxD,OAAO,QAAQ,IAAI,IAAI,CAAC;AAC1B,CAAC;AAWD,MAAM,YAAY,GAAgD;IAChE,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,iBAAiB,E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,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;SACxE;QACD,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IACH,OAAO,qBAAqB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * The options that modify the style of a circular path.\n */\nexport interface CircularPathOptions {\n /** The line color of the path. Range from 000000 to FFFFFF. */\n lineColor?: string;\n /** The line opacity of the path. Range from 0 to 1. */\n lineOpacity?: number;\n /** The line width of the line. Should be greater than 0. */\n lineWidthInPixels?: number;\n}\n\n/**\n * The options that modify the style of a polygonal path.\n */\nexport interface PolygonalPathOptions extends CircularPathOptions {\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 000000 to FFFFFF.*/\n fillColor?: string;\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 0 to 1.*/\n fillOpacity?: number;\n}\n\ninterface PathOptionsForRequest extends PolygonalPathOptions {\n radius?: number;\n}\n\n/**\n * Specify a circular path.\n */\nexport interface CircularPath {\n /** The center of the circular path. */\n center: LatLon;\n /** The radius of the circular path. */\n radiusInMeters: number;\n /** The options that modify the style of the circular path. */\n options?: CircularPathOptions;\n}\n\nfunction isCircularPath(path: PolygonalPath | CircularPath): path is CircularPath {\n return \"center\" in path;\n}\n/**\n * Specify a polygonal path.\n */\nexport interface PolygonalPath {\n /** The coordinates of the polygonal path. The identical coordinate in the first & last position construct a closed polygon.*/\n coordinates: LatLon[];\n /** The options that modify the style of the polygonal path. */\n options?: PolygonalPathOptions;\n}\n\nconst optionKeyMap: Record<keyof PathOptionsForRequest, string> = {\n lineColor: \"lc\",\n lineOpacity: \"la\",\n fillColor: \"fc\",\n fillOpacity: \"fa\",\n lineWidthInPixels: \"lw\",\n radius: \"ra\",\n};\n\nfunction isOptionKey(key: any): key is keyof PathOptionsForRequest {\n return key in optionKeyMap;\n}\n\nfunction comosePathVal(coordinates: LatLon[], options: PathOptionsForRequest): string {\n // compose the coordinates query string\n const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKey(key)) throw Error(`Unknown key ${key}`);\n queryStr += `${queryStr ? \"|\" : \"\"}${optionKeyMap[key]}${val}`;\n return queryStr;\n }, \"\");\n return optionsQueryStr + \"||\" + coordinatesQueryStr;\n}\n\n/**\n * Create a path query string for _get map static image_ request.\n *\n * @example\n * ```ts\n * const circularPath = {\n * center: [52.4559, 13.228],\n * radiusInMeters: 10000,\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const linearPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const polygonPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * [52.577, 13.35],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * fillColor: \"FFFFFF\",\n * fillOpacity: 0.8,\n * },\n * };\n *\n * const path = createPathQuery([circularPath, linearPath, polygonPath]);\n * // Send the request\n * const response = await client.path(\"/map/static/{format}\", \"png\").get({\n * queryParameters: {\n * bbox: [13.228,52.4559,13.5794,52.629],\n * path: path\n * }\n * });\n * ```\n *\n * @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.\n * @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.\n */\nexport function createPathQuery(paths: Array<PolygonalPath | CircularPath>): string {\n const pathQueries = paths.map((path) => {\n if (isCircularPath(path)) {\n const { center, radiusInMeters, options } = path;\n return comosePathVal([center], { ...options, radius: radiusInMeters });\n }\n return comosePathVal(path.coordinates, path.options || {});\n });\n return createMultiCollection(\"path\", pathQueries);\n}\n"]}
1
+ {"version":3,"file":"createPathQuery.js","sourceRoot":"","sources":["../../src/createPathQuery.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAwChE,SAAS,cAAc,CAAC,IAAkC;IACxD,OAAO,QAAQ,IAAI,IAAI,CAAC;AAC1B,CAAC;AAWD,MAAM,YAAY,GAAgD;IAChE,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,IAAI;IACvB,MAAM,EAAE,IAAI;CACb,CAAC;AAEF,SAAS,WAAW,CAAC,GAAQ;IAC3B,OAAO,GAAG,IAAI,YAAY,CAAC;AAC7B,CAAC;AAED,SAAS,aAAa,CAAC,WAAqB,EAAE,OAA8B;IAC1E,uCAAuC;IACvC,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvF,mCAAmC;IACnC,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE;QACtF,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;YAAE,MAAM,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC,CAAC;QACzD,QAAQ,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC;QAC/D,OAAO,QAAQ,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,eAAe,GAAG,IAAI,GAAG,mBAAmB,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,UAAU,eAAe,CAAC,KAA0C;IACxE,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACrC,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;YACjD,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,kCAAO,OAAO,KAAE,MAAM,EAAE,cAAc,IAAG,CAAC;QACzE,CAAC;QACD,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IACH,OAAO,qBAAqB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * The options that modify the style of a circular path.\n */\nexport interface CircularPathOptions {\n /** The line color of the path. Range from 000000 to FFFFFF. */\n lineColor?: string;\n /** The line opacity of the path. Range from 0 to 1. */\n lineOpacity?: number;\n /** The line width of the line. Should be greater than 0. */\n lineWidthInPixels?: number;\n}\n\n/**\n * The options that modify the style of a polygonal path.\n */\nexport interface PolygonalPathOptions extends CircularPathOptions {\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 000000 to FFFFFF.*/\n fillColor?: string;\n /** The fill color of the path. This only works if the path is a closed shape like polygon or circle. Range from 0 to 1.*/\n fillOpacity?: number;\n}\n\ninterface PathOptionsForRequest extends PolygonalPathOptions {\n radius?: number;\n}\n\n/**\n * Specify a circular path.\n */\nexport interface CircularPath {\n /** The center of the circular path. */\n center: LatLon;\n /** The radius of the circular path. */\n radiusInMeters: number;\n /** The options that modify the style of the circular path. */\n options?: CircularPathOptions;\n}\n\nfunction isCircularPath(path: PolygonalPath | CircularPath): path is CircularPath {\n return \"center\" in path;\n}\n/**\n * Specify a polygonal path.\n */\nexport interface PolygonalPath {\n /** The coordinates of the polygonal path. The identical coordinate in the first & last position construct a closed polygon.*/\n coordinates: LatLon[];\n /** The options that modify the style of the polygonal path. */\n options?: PolygonalPathOptions;\n}\n\nconst optionKeyMap: Record<keyof PathOptionsForRequest, string> = {\n lineColor: \"lc\",\n lineOpacity: \"la\",\n fillColor: \"fc\",\n fillOpacity: \"fa\",\n lineWidthInPixels: \"lw\",\n radius: \"ra\",\n};\n\nfunction isOptionKey(key: any): key is keyof PathOptionsForRequest {\n return key in optionKeyMap;\n}\n\nfunction comosePathVal(coordinates: LatLon[], options: PathOptionsForRequest): string {\n // compose the coordinates query string\n const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKey(key)) throw Error(`Unknown key ${key}`);\n queryStr += `${queryStr ? \"|\" : \"\"}${optionKeyMap[key]}${val}`;\n return queryStr;\n }, \"\");\n return optionsQueryStr + \"||\" + coordinatesQueryStr;\n}\n\n/**\n * Create a path query string for _get map static image_ request.\n *\n * @example\n * ```ts\n * const circularPath = {\n * center: [52.4559, 13.228],\n * radiusInMeters: 10000,\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const linearPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * },\n * };\n *\n * const polygonPath = {\n * coordinates: [\n * [52.577, 13.35],\n * [52.6, 13.2988],\n * [52.32, 13.2988],\n * [52.577, 13.35],\n * ],\n * options: {\n * lineColor: \"000000\",\n * lineOpacity: 0.9,\n * lineWidthInPixels: 2,\n * fillColor: \"FFFFFF\",\n * fillOpacity: 0.8,\n * },\n * };\n *\n * const path = createPathQuery([circularPath, linearPath, polygonPath]);\n * // Send the request\n * const response = await client.path(\"/map/static/{format}\", \"png\").get({\n * queryParameters: {\n * bbox: [13.228,52.4559,13.5794,52.629],\n * path: path\n * }\n * });\n * ```\n *\n * @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.\n * @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.\n */\nexport function createPathQuery(paths: Array<PolygonalPath | CircularPath>): string {\n const pathQueries = paths.map((path) => {\n if (isCircularPath(path)) {\n const { center, radiusInMeters, options } = path;\n return comosePathVal([center], { ...options, radius: radiusInMeters });\n }\n return comosePathVal(path.coordinates, path.options || {});\n });\n return createMultiCollection(\"path\", pathQueries);\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createMultiCollection } from "./createMultiCollection";
4
4
  const optionKeyMap = {
5
5
  opacity: "al",
@@ -1 +1 @@
1
- {"version":3,"file":"createPinsQuery.js","sourceRoot":"","sources":["../../src/createPinsQuery.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AA2ChE,MAAM,YAAY,GAAqC;IACrD,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,IAAI;IACjB,UAAU,E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YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,SAAS,EAAE;YACjD,OAAO,GAAG,QAAQ,GAAG,eAAe,KAAK,YAAY,EAAE,CAAC;SACzD;QACD,OAAO,SAAS,eAAe,KAAK,YAAY,KAAK,QAAQ,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,OAAO,qBAAqB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * Specify how the pin's position and label text.\n */\nexport interface Pin {\n /** The coordinate of the pin. */\n coordinate: LatLon;\n /** The label text for the pin. */\n label?: string;\n}\n\n/**\n * The pin options for default/none image style..\n */\nexport interface PinOptions {\n /** The opacity of the pin. Range from 0 to 1 */\n opacity?: number;\n /**\n * The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and is at the top center of custom pushpins (see below).\n * To override the label anchor, using the _labelAnchor_ option and provide X and Y pixel coordinates for the anchor.\n * These coordinates are relative to the top left corner of the pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down.\n * For example, to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image, use \\{labelAnchor: [10, -4]\\}\n * */\n labelAnchor?: [number, number];\n /** Color of the label. Range from 000000 to FFFFFF */\n labelColor?: string;\n /** Size of the label in pixels. */\n labelSizeInPixels?: number;\n /**\n * By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures the location that you're trying to highlight.\n * To override the anchor location of the pin image, use the _pinAnchor_ option. This uses the same format as the _labelAnchor_ options.\n * For example, if your custom pin image has the tip of the pin at the top left corner of the image, you can set the anchor to that spot by using \\{pinAnchor: [0, 0]\\}\n */\n pinAnchor?: [number, number];\n /** The ration of the pin. Range from -360 to 360*/\n rotationInDegree?: number;\n /** The scale of the pin. Should be greater than 0. */\n scale?: number;\n /** Color of the pin. Range from 000000 to FFFFFF */\n pinColor?: string;\n}\n\nconst optionKeyMap: Record<keyof PinOptions, string> = {\n opacity: \"al\",\n labelAnchor: \"la\",\n labelColor: \"lc\",\n labelSizeInPixels: \"ls\",\n pinAnchor: \"an\",\n rotationInDegree: \"ro\",\n scale: \"sc\",\n pinColor: \"co\",\n};\n\nfunction isOptionKeyMap(key: any): key is keyof PinOptions {\n return key in optionKeyMap;\n}\n\nexport interface PinSet {\n pins: Pin[];\n pinImage?: \"default\" | \"none\" | string;\n options?: PinOptions;\n}\n/**\n * Create a pin query string for _get map static image_\n *\n * @example\n * ```ts\n *\n * const pins = {\n * pins: [\n * { coordinate: [52.577, 13.35], label: \"Label start\" },\n * { coordinate: [52.6, 13.2988], label: \"Label end\" },\n * ],\n * pinImage: \"<image source url || default || none>\"\n * options: {\n * scale: 0.9,\n * pinColor: \"FF0000\",\n * labelColor: \"0000FF\",\n * labelSizeInPixels: 18,\n * }\n * );\n * const res = await client\n * .path(\"/map/static/{format}\", \"png\")\n * .get({\n * queryParameters: {\n * bbox: [13.228, 52.4559, 13.5794, 52.62],\n * zoom: 10,\n * pins: pins,\n * },\n * skipUrlEncoding: true,\n * })\n * ```\n *\n * @param pins - An array of {@link Pin} that specify the positions and label text of each pin.\n * @param pinImage - Specify the image source for custom pin. Set this to \"none\" if you don't want to show a pin image.\n * @param options - The style options of the pins. See {@link PinOptions}\n * @returns - The composed query string.\n */\n\nexport function createPinsQuery(pinSets: PinSet[]): string {\n const pinsQueries = pinSets.map(({ pins, pinImage = \"default\", options = {} }) => {\n // compose the pins' position query string\n const pinsQueryStr = pins\n .map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : \"\"}${lon} ${lat}`)\n .join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKeyMap(key)) throw Error(`Unexpected option: ${key}`);\n if (Array.isArray(val)) return (queryStr += `|${optionKeyMap[key]}${val[0]} ${val[1]}`);\n return (queryStr += `|${optionKeyMap[key]}${val}`);\n }, \"\");\n if (pinImage === \"none\" || pinImage === \"default\") {\n return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;\n }\n return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;\n });\n return createMultiCollection(\"pins\", pinsQueries);\n}\n"]}
1
+ {"version":3,"file":"createPinsQuery.js","sourceRoot":"","sources":["../../src/createPinsQuery.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AA2ChE,MAAM,YAAY,GAAqC;IACrD,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;IAChB,iBAAiB,EAAE,IAAI;IACvB,SAAS,EAAE,IAAI;IACf,gBAAgB,EAAE,IAAI;IACtB,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,SAAS,cAAc,CAAC,GAAQ;IAC9B,OAAO,GAAG,IAAI,YAAY,CAAC;AAC7B,CAAC;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,MAAM,UAAU,eAAe,CAAC,OAAiB;IAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,EAAE;QAC/E,0CAA0C;QAC1C,MAAM,YAAY,GAAG,IAAI;aACtB,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;aACvF,IAAI,CAAC,GAAG,CAAC,CAAC;QACb,mCAAmC;QACnC,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE;YACtF,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;gBAAE,MAAM,KAAK,CAAC,sBAAsB,GAAG,EAAE,CAAC,CAAC;YACnE,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;gBAAE,OAAO,CAAC,QAAQ,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACxF,OAAO,CAAC,QAAQ,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAClD,OAAO,GAAG,QAAQ,GAAG,eAAe,KAAK,YAAY,EAAE,CAAC;QAC1D,CAAC;QACD,OAAO,SAAS,eAAe,KAAK,YAAY,KAAK,QAAQ,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,OAAO,qBAAqB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection\";\n\n/**\n * Specify how the pin's position and label text.\n */\nexport interface Pin {\n /** The coordinate of the pin. */\n coordinate: LatLon;\n /** The label text for the pin. */\n label?: string;\n}\n\n/**\n * The pin options for default/none image style..\n */\nexport interface PinOptions {\n /** The opacity of the pin. Range from 0 to 1 */\n opacity?: number;\n /**\n * The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and is at the top center of custom pushpins (see below).\n * To override the label anchor, using the _labelAnchor_ option and provide X and Y pixel coordinates for the anchor.\n * These coordinates are relative to the top left corner of the pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down.\n * For example, to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image, use \\{labelAnchor: [10, -4]\\}\n * */\n labelAnchor?: [number, number];\n /** Color of the label. Range from 000000 to FFFFFF */\n labelColor?: string;\n /** Size of the label in pixels. */\n labelSizeInPixels?: number;\n /**\n * By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures the location that you're trying to highlight.\n * To override the anchor location of the pin image, use the _pinAnchor_ option. This uses the same format as the _labelAnchor_ options.\n * For example, if your custom pin image has the tip of the pin at the top left corner of the image, you can set the anchor to that spot by using \\{pinAnchor: [0, 0]\\}\n */\n pinAnchor?: [number, number];\n /** The ration of the pin. Range from -360 to 360*/\n rotationInDegree?: number;\n /** The scale of the pin. Should be greater than 0. */\n scale?: number;\n /** Color of the pin. Range from 000000 to FFFFFF */\n pinColor?: string;\n}\n\nconst optionKeyMap: Record<keyof PinOptions, string> = {\n opacity: \"al\",\n labelAnchor: \"la\",\n labelColor: \"lc\",\n labelSizeInPixels: \"ls\",\n pinAnchor: \"an\",\n rotationInDegree: \"ro\",\n scale: \"sc\",\n pinColor: \"co\",\n};\n\nfunction isOptionKeyMap(key: any): key is keyof PinOptions {\n return key in optionKeyMap;\n}\n\nexport interface PinSet {\n pins: Pin[];\n pinImage?: \"default\" | \"none\" | string;\n options?: PinOptions;\n}\n/**\n * Create a pin query string for _get map static image_\n *\n * @example\n * ```ts\n *\n * const pins = {\n * pins: [\n * { coordinate: [52.577, 13.35], label: \"Label start\" },\n * { coordinate: [52.6, 13.2988], label: \"Label end\" },\n * ],\n * pinImage: \"<image source url || default || none>\"\n * options: {\n * scale: 0.9,\n * pinColor: \"FF0000\",\n * labelColor: \"0000FF\",\n * labelSizeInPixels: 18,\n * }\n * );\n * const res = await client\n * .path(\"/map/static/{format}\", \"png\")\n * .get({\n * queryParameters: {\n * bbox: [13.228, 52.4559, 13.5794, 52.62],\n * zoom: 10,\n * pins: pins,\n * },\n * skipUrlEncoding: true,\n * })\n * ```\n *\n * @param pins - An array of {@link Pin} that specify the positions and label text of each pin.\n * @param pinImage - Specify the image source for custom pin. Set this to \"none\" if you don't want to show a pin image.\n * @param options - The style options of the pins. See {@link PinOptions}\n * @returns - The composed query string.\n */\n\nexport function createPinsQuery(pinSets: PinSet[]): string {\n const pinsQueries = pinSets.map(({ pins, pinImage = \"default\", options = {} }) => {\n // compose the pins' position query string\n const pinsQueryStr = pins\n .map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : \"\"}${lon} ${lat}`)\n .join(\"|\");\n // compose the options query string\n const optionsQueryStr = Object.entries(options).reduce<string>((queryStr, [key, val]) => {\n if (!isOptionKeyMap(key)) throw Error(`Unexpected option: ${key}`);\n if (Array.isArray(val)) return (queryStr += `|${optionKeyMap[key]}${val[0]} ${val[1]}`);\n return (queryStr += `|${optionKeyMap[key]}${val}`);\n }, \"\");\n if (pinImage === \"none\" || pinImage === \"default\") {\n return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;\n }\n return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;\n });\n return createMultiCollection(\"pins\", pinsQueries);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=clientDefinitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../../src/generated/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n RenderGetMapTileParameters,\n RenderGetMapTilesetParameters,\n RenderGetMapAttributionParameters,\n RenderGetMapStateTileParameters,\n RenderGetCopyrightCaptionParameters,\n RenderGetMapStaticImageParameters,\n RenderGetCopyrightFromBoundingBoxParameters,\n RenderGetCopyrightForTileParameters,\n RenderGetCopyrightForWorldParameters\n} from \"./parameters\";\nimport {\n RenderGetMapTile200Response,\n RenderGetMapTileDefaultResponse,\n RenderGetMapTileset200Response,\n RenderGetMapTilesetDefaultResponse,\n RenderGetMapAttribution200Response,\n RenderGetMapAttributionDefaultResponse,\n RenderGetMapStateTile200Response,\n RenderGetMapStateTileDefaultResponse,\n RenderGetCopyrightCaption200Response,\n RenderGetCopyrightCaptionDefaultResponse,\n RenderGetMapStaticImage200Response,\n RenderGetMapStaticImageDefaultResponse,\n RenderGetCopyrightFromBoundingBox200Response,\n RenderGetCopyrightFromBoundingBoxDefaultResponse,\n RenderGetCopyrightForTile200Response,\n RenderGetCopyrightForTileDefaultResponse,\n RenderGetCopyrightForWorld200Response,\n RenderGetCopyrightForWorldDefaultResponse\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetMapTile {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * The Get Map Tiles API allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control (Web SDK) and Android SDK.\n */\n get(\n options: RenderGetMapTileParameters\n ): StreamableMethod<\n RenderGetMapTile200Response | RenderGetMapTileDefaultResponse\n >;\n}\n\nexport interface GetMapTileset {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * The Get Map Tileset API allows users to request metadata for a tileset.\n */\n get(\n options: RenderGetMapTilesetParameters\n ): StreamableMethod<\n RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse\n >;\n}\n\nexport interface GetMapAttribution {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * The Get Map Attribution API allows users to request map copyright attribution information for a section of a tileset.\n */\n get(\n options: RenderGetMapAttributionParameters\n ): StreamableMethod<\n RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse\n >;\n}\n\nexport interface GetMapStateTile {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling (see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid))\n */\n get(\n options: RenderGetMapStateTileParameters\n ): StreamableMethod<\n RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse\n >;\n}\n\nexport interface GetCopyrightCaption {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Copyrights API is designed to serve copyright information for Render Tile\n * service. In addition to basic copyright for the whole map, API is serving\n * specific groups of copyrights for some countries/regions.\n *\n * As an alternative to copyrights for map request, one can receive captions\n * for displaying the map provider information on the map.\n */\n get(\n options?: RenderGetCopyrightCaptionParameters\n ): StreamableMethod<\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n >;\n}\n\nexport interface GetMapStaticImage {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * The static image service renders a user-defined, rectangular image containing a map section using a zoom level from 0 to 20. The supported resolution range for the map image is from 1x1 to 8192x8192. If you are deciding when to use the static image service over the map tile service, you may want to consider how you would like to interact with the rendered map. If the map contents will be relatively unchanging, a static map is a good choice. If you want to support a lot of zooming, panning and changing of the map content, the map tile service would be a better choice.\n *\n * Service also provides Image Composition functionality to get a static image back with additional data like; pushpins and geometry overlays with following capabilities.\n *\n * - Specify multiple pushpin styles\n * - Render circle, polyline and polygon geometry types.\n *\n * Please see [How-to-Guide](https://aka.ms/AzureMapsHowToGuideImageCompositor) for detailed examples.\n *\n * _Note_ : Either **center** or **bbox** parameter must be supplied to the\n * API.\n * <br><br>\n * The supported Lat and Lon ranges when using the **bbox** parameter, are as follows:\n * <br><br>\n *\n * |Zoom Level | Max Lon Range | Max Lat Range|\n * |:----------|:----------------|:-------------|\n * |0 | 360.0 | 170.0 |\n * |1 | 360.0 | 170.0 |\n * |2 | 360.0 | 170.0 |\n * |3 | 360.0 | 170.0 |\n * |4 | 360.0 | 170.0 |\n * |5 | 180.0 | 85.0 |\n * |6 | 90.0 | 42.5 |\n * |7 | 45.0 | 21.25 |\n * |8 | 22.5 | 10.625 |\n * |9 | 11.25 | 5.3125 |\n * |10 | 5.625 | 2.62625 |\n * |11 | 2.8125 | 1.328125 |\n * |12 | 1.40625 | 0.6640625 |\n * |13 | 0.703125 | 0.33203125 |\n * |14 | 0.3515625 | 0.166015625 |\n * |15 | 0.17578125 | 0.0830078125 |\n * |16 | 0.087890625 | 0.0415039063 |\n * |17 | 0.0439453125 | 0.0207519531 |\n * |18 | 0.0219726563 | 0.0103759766 |\n * |19 | 0.0109863281 | 0.0051879883 |\n * |20 | 0.0054931641 | 0.0025939941 |\n */\n get(\n options?: RenderGetMapStaticImageParameters\n ): StreamableMethod<\n RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse\n >;\n}\n\nexport interface GetCopyrightFromBoundingBox {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates\n */\n get(\n options: RenderGetCopyrightFromBoundingBoxParameters\n ): StreamableMethod<\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n >;\n}\n\nexport interface GetCopyrightForTile {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n * Returns the copyright information for a given tile. To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates (see: Zoom Levels and Tile Grid).\n */\n get(\n options: RenderGetCopyrightForTileParameters\n ): StreamableMethod<\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n >;\n}\n\nexport interface GetCopyrightForWorld {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n * Copyrights API is designed to serve copyright information for Render Tile service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n * Returns the copyright information for the world. To obtain the default copyright information for the whole world, do not specify a tile or bounding box.\n */\n get(\n options?: RenderGetCopyrightForWorldParameters\n ): StreamableMethod<\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/map/tile' has methods for the following verbs: get */\n (path: \"/map/tile\"): GetMapTile;\n /** Resource for '/map/tileset' has methods for the following verbs: get */\n (path: \"/map/tileset\"): GetMapTileset;\n /** Resource for '/map/attribution' has methods for the following verbs: get */\n (path: \"/map/attribution\"): GetMapAttribution;\n /** Resource for '/map/statetile' has methods for the following verbs: get */\n (path: \"/map/statetile\"): GetMapStateTile;\n /** Resource for '/map/copyright/caption/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/caption/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightCaption;\n /** Resource for '/map/static/\\{format\\}' has methods for the following verbs: get */\n (path: \"/map/static/{format}\", format: \"png\"): GetMapStaticImage;\n /** Resource for '/map/copyright/bounding/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/bounding/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightFromBoundingBox;\n /** Resource for '/map/copyright/tile/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/tile/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightForTile;\n /** Resource for '/map/copyright/world/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/world/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightForWorld;\n}\n\nexport type MapsRenderClient = Client & {\n path: Routes;\n};\n"]}
1
+ {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../../src/generated/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n RenderGetMapTileParameters,\n RenderGetMapTilesetParameters,\n RenderGetMapAttributionParameters,\n RenderGetMapStateTileParameters,\n RenderGetCopyrightCaptionParameters,\n RenderGetMapStaticImageParameters,\n RenderGetCopyrightFromBoundingBoxParameters,\n RenderGetCopyrightForTileParameters,\n RenderGetCopyrightForWorldParameters\n} from \"./parameters\";\nimport {\n RenderGetMapTile200Response,\n RenderGetMapTileDefaultResponse,\n RenderGetMapTileset200Response,\n RenderGetMapTilesetDefaultResponse,\n RenderGetMapAttribution200Response,\n RenderGetMapAttributionDefaultResponse,\n RenderGetMapStateTile200Response,\n RenderGetMapStateTileDefaultResponse,\n RenderGetCopyrightCaption200Response,\n RenderGetCopyrightCaptionDefaultResponse,\n RenderGetMapStaticImage200Response,\n RenderGetMapStaticImageDefaultResponse,\n RenderGetCopyrightFromBoundingBox200Response,\n RenderGetCopyrightFromBoundingBoxDefaultResponse,\n RenderGetCopyrightForTile200Response,\n RenderGetCopyrightForTileDefaultResponse,\n RenderGetCopyrightForWorld200Response,\n RenderGetCopyrightForWorldDefaultResponse\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetMapTile {\n /**\n *\n * The `Get Map Tiles` API in an HTTP GET request that allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control ([Web SDK](/azure/azure-maps/about-azure-maps#web-sdk)) and [Android SDK](/azure/azure-maps/about-azure-maps#android-sdk).\n */\n get(\n options: RenderGetMapTileParameters\n ): StreamableMethod<\n RenderGetMapTile200Response | RenderGetMapTileDefaultResponse\n >;\n}\n\nexport interface GetMapTileset {\n /**\n *\n * The Get Map Tileset API allows users to request metadata for a tileset.\n */\n get(\n options: RenderGetMapTilesetParameters\n ): StreamableMethod<\n RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse\n >;\n}\n\nexport interface GetMapAttribution {\n /**\n *\n * The `Get Map Attribution` API allows users to request map copyright attribution information for a section of a tileset.\n */\n get(\n options: RenderGetMapAttributionParameters\n ): StreamableMethod<\n RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse\n >;\n}\n\nexport interface GetMapStateTile {\n /**\n *\n * Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling. For more information, see [Zoom Levels and Tile Grid](/azure/location-based-services/zoom-levels-and-tile-grid).\n */\n get(\n options: RenderGetMapStateTileParameters\n ): StreamableMethod<\n RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse\n >;\n}\n\nexport interface GetCopyrightCaption {\n /**\n *\n * The `Get Copyright Caption` API is an HTTP GET request designed to serve copyright information to be used with tiles requested from the Render service. In addition to a basic copyright for the whole map, it can serve specific groups of copyrights for some countries/regions.\n *\n * As an alternative to copyrights for map request, it can also return captions for displaying provider information on the map.\n */\n get(\n options?: RenderGetCopyrightCaptionParameters\n ): StreamableMethod<\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n >;\n}\n\nexport interface GetMapStaticImage {\n /**\n * This rendering API produces static, rasterized map views of a user-defined area. It's suitable for lightweight web applications, when the desired user experience doesn't require interactive map controls, or when bandwidth is limited. This API is also useful for embedding maps in applications outside of the browser, in backend services, report generation, or desktop applications.\n *\n * This API includes parameters for basic data visualization:\n *\n * - Labeled pushpins in multiple styles.\n * - Render circle, path, and polygon geometry types.\n *\n * For more information and detailed examples, see [Render custom data on a raster map](/azure/azure-maps/how-to-render-custom-data).\n * <br><br>\n * The dimensions of the bbox parameter are constrained, depending on the zoom level. This ensures the resulting image has an appropriate level of detail.\n * <br><br>\n *\n * |Zoom Level | Min Lon Range | Max Lon Range | Min Lat Range| Max Lat Range|\n * |:----------|:----------------|:----------------|:----------------|:-------------|\n * |0 | 56.25 | 360.0 | 30.1105585173 | 180.0 |\n * |1 | 28.125 | 360.0 | 14.87468995 | 180.0 |\n * |2 | 14.063 | 351.5625 | 7.4130741851 | 137.9576312246 |\n * |3 | 7.03125 | 175.78125 | 3.7034501005 | 73.6354071932 |\n * |4 | 3.515625 | 87.890625 | 1.8513375155 | 35.4776115315 |\n * |5 | 1.7578125 | 43.9453125 | 0.925620264 | 17.4589959239 |\n * |6 | 0.87890625 | 21.97265625 | 0.4628040687 | 8.6907788223 |\n * |7 | 0.439453125 | 10.986328125 | 0.2314012764 | 4.3404320789 |\n * |8 | 0.2197265625 | 5.4931640625 | 0.1157005434 | 2.1695927024 |\n * |9 | 0.1098632812 | 2.7465820312 | 0.0578502599 | 1.0847183194 |\n * |10 | 0.0549316406 | 1.3732910156 | 0.0289251285 | 0.5423494021 |\n * |11 | 0.0274658203 | 0.6866455078 | 0.014462564 | 0.2711734813 |\n * |12 | 0.0137329102 | 0.3433227539 | 0.007231282 | 0.1355865882 |\n * |13 | 0.0068664551 | 0.171661377 | 0.003615641 | 0.067793275 |\n * |14 | 0.0034332275 | 0.0858306885 | 0.0018078205 | 0.0338966351 |\n * |15 | 0.0017166138 | 0.0429153442 | 0.0009039102 | 0.0169483173 |\n * |16 | 0.0008583069 | 0.0214576721 | 0.0004519551 | 0.0084741586 |\n * |17 | 0.0004291534 | 0.0107288361 | 0.0002259776 | 0.0042370793 |\n * |18 | 0.0002145767 | 0.005364418 | 0.0001129888 | 0.0021185396 |\n * |19 | 0.0001072884 | 0.002682209 | 5.64944E-05 | 0.0010592698 |\n * |20 | 5.36442E-05 | 0.0013411045 | 2.82472E-05 | 0.0005296349 |\n *\n * _Note_ : Either **center** or **bbox** parameter must be supplied to the API.\n */\n get(\n options?: RenderGetMapStaticImageParameters\n ): StreamableMethod<\n RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse\n >;\n}\n\nexport interface GetCopyrightFromBoundingBox {\n /**\n *\n * Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates\n */\n get(\n options: RenderGetCopyrightFromBoundingBoxParameters\n ): StreamableMethod<\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n >;\n}\n\nexport interface GetCopyrightForTile {\n /**\n *\n * To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates. For more information, see [Zoom Levels and Tile Grid](/azure/azure-maps/zoom-levels-and-tile-grid).\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\n get(\n options: RenderGetCopyrightForTileParameters\n ): StreamableMethod<\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n >;\n}\n\nexport interface GetCopyrightForWorld {\n /**\n *\n * Returns the copyright information for the world. To obtain the default copyright information for the whole world, don't specify a tile or bounding box.\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\n get(\n options?: RenderGetCopyrightForWorldParameters\n ): StreamableMethod<\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/map/tile' has methods for the following verbs: get */\n (path: \"/map/tile\"): GetMapTile;\n /** Resource for '/map/tileset' has methods for the following verbs: get */\n (path: \"/map/tileset\"): GetMapTileset;\n /** Resource for '/map/attribution' has methods for the following verbs: get */\n (path: \"/map/attribution\"): GetMapAttribution;\n /** Resource for '/map/statetile' has methods for the following verbs: get */\n (path: \"/map/statetile\"): GetMapStateTile;\n /** Resource for '/map/copyright/caption/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/caption/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightCaption;\n /** Resource for '/map/static' has methods for the following verbs: get */\n (path: \"/map/static\"): GetMapStaticImage;\n /** Resource for '/map/copyright/bounding/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/bounding/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightFromBoundingBox;\n /** Resource for '/map/copyright/tile/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/tile/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightForTile;\n /** Resource for '/map/copyright/world/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/world/{format}\",\n format: \"json\" | \"xml\"\n ): GetCopyrightForWorld;\n}\n\nexport type MapsRenderClient = Client & {\n path: Routes;\n};\n"]}