@azure-rest/maps-render 1.0.0-beta.1

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 (33) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +224 -0
  3. package/dist/index.js +365 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist-esm/src/createMultiCollection.js +13 -0
  6. package/dist-esm/src/createMultiCollection.js.map +1 -0
  7. package/dist-esm/src/createPathQuery.js +97 -0
  8. package/dist-esm/src/createPathQuery.js.map +1 -0
  9. package/dist-esm/src/createPinsQuery.js +74 -0
  10. package/dist-esm/src/createPinsQuery.js.map +1 -0
  11. package/dist-esm/src/generated/clientDefinitions.js +4 -0
  12. package/dist-esm/src/generated/clientDefinitions.js.map +1 -0
  13. package/dist-esm/src/generated/index.js +11 -0
  14. package/dist-esm/src/generated/index.js.map +1 -0
  15. package/dist-esm/src/generated/isUnexpected.js +77 -0
  16. package/dist-esm/src/generated/isUnexpected.js.map +1 -0
  17. package/dist-esm/src/generated/mapsRenderClient.js +25 -0
  18. package/dist-esm/src/generated/mapsRenderClient.js.map +1 -0
  19. package/dist-esm/src/generated/outputModels.js +4 -0
  20. package/dist-esm/src/generated/outputModels.js.map +1 -0
  21. package/dist-esm/src/generated/parameters.js +4 -0
  22. package/dist-esm/src/generated/parameters.js.map +1 -0
  23. package/dist-esm/src/generated/responses.js +4 -0
  24. package/dist-esm/src/generated/responses.js.map +1 -0
  25. package/dist-esm/src/index.js +9 -0
  26. package/dist-esm/src/index.js.map +1 -0
  27. package/dist-esm/src/mapsRender.js +29 -0
  28. package/dist-esm/src/mapsRender.js.map +1 -0
  29. package/dist-esm/src/positionToTileXY.js +44 -0
  30. package/dist-esm/src/positionToTileXY.js.map +1 -0
  31. package/package.json +130 -0
  32. package/review/maps-render.api.md +555 -0
  33. package/types/maps-render-rest.d.ts +1225 -0
@@ -0,0 +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.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 { AzureKeyCredential, isTokenCredential, TokenCredential } 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;\nexport default function MapsRender(\n credential: TokenCredential | AzureKeyCredential,\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 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","optionKeyMap"],"mappings":";;;;;;;;;AAAA;AAOA;;;AAGG;AACqB,SAAA,YAAY,CAClC,WAA0B,EAC1B,UA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MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAO,OAAO,CAAA,EAAA,EAAE,MAAM,EAAE,cAAc,EAAA,CAAA,CAAG,CAAC;AACxE,SAAA;AACD,QAAA,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;AAC7D,KAAC,CAAC,CAAC;AACH,IAAA,OAAO,qBAAqB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACpD;;ACpJA;;;;;;;;"}
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ /**
4
+ * @internal
5
+ * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).
6
+ * This should be removed once the core-client support collectionFormat: multi.
7
+ */
8
+ export function createMultiCollection(key, values) {
9
+ return values.slice(1).reduce((acc, value) => {
10
+ return `${acc}&${key}=${value}`;
11
+ }, values[0] || "");
12
+ }
13
+ //# sourceMappingURL=createMultiCollection.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,97 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { createMultiCollection } from "./createMultiCollection";
4
+ function isCircularPath(path) {
5
+ return "center" in path;
6
+ }
7
+ const optionKeyMap = {
8
+ lineColor: "lc",
9
+ lineOpacity: "la",
10
+ fillColor: "fc",
11
+ fillOpacity: "fa",
12
+ lineWidthInPixels: "lw",
13
+ radius: "ra",
14
+ };
15
+ function isOptionKey(key) {
16
+ return key in optionKeyMap;
17
+ }
18
+ function comosePathVal(coordinates, options) {
19
+ // compose the coordinates query string
20
+ const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join("|");
21
+ // compose the options query string
22
+ const optionsQueryStr = Object.entries(options).reduce((queryStr, [key, val]) => {
23
+ if (!isOptionKey(key))
24
+ throw Error(`Unknown key ${key}`);
25
+ queryStr += `${queryStr ? "|" : ""}${optionKeyMap[key]}${val}`;
26
+ return queryStr;
27
+ }, "");
28
+ return optionsQueryStr + "||" + coordinatesQueryStr;
29
+ }
30
+ /**
31
+ * Create a path query string for _get map static image_ request.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const circularPath = {
36
+ * center: [52.4559, 13.228],
37
+ * radiusInMeters: 10000,
38
+ * options: {
39
+ * lineColor: "000000",
40
+ * lineOpacity: 0.9,
41
+ * lineWidthInPixels: 2,
42
+ * },
43
+ * };
44
+ *
45
+ * const linearPath = {
46
+ * coordinates: [
47
+ * [52.577, 13.35],
48
+ * [52.6, 13.2988],
49
+ * [52.32, 13.2988],
50
+ * ],
51
+ * options: {
52
+ * lineColor: "000000",
53
+ * lineOpacity: 0.9,
54
+ * lineWidthInPixels: 2,
55
+ * },
56
+ * };
57
+ *
58
+ * const polygonPath = {
59
+ * coordinates: [
60
+ * [52.577, 13.35],
61
+ * [52.6, 13.2988],
62
+ * [52.32, 13.2988],
63
+ * [52.577, 13.35],
64
+ * ],
65
+ * options: {
66
+ * lineColor: "000000",
67
+ * lineOpacity: 0.9,
68
+ * lineWidthInPixels: 2,
69
+ * fillColor: "FFFFFF",
70
+ * fillOpacity: 0.8,
71
+ * },
72
+ * };
73
+ *
74
+ * const path = createPathQuery([circularPath, linearPath, polygonPath]);
75
+ * // Send the request
76
+ * const response = await client.path("/map/static/{format}", "png").get({
77
+ * queryParameters: {
78
+ * bbox: [13.228,52.4559,13.5794,52.629],
79
+ * path: path
80
+ * }
81
+ * });
82
+ * ```
83
+ *
84
+ * @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.
85
+ * @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.
86
+ */
87
+ export function createPathQuery(paths) {
88
+ const pathQueries = paths.map((path) => {
89
+ if (isCircularPath(path)) {
90
+ const { center, radiusInMeters, options } = path;
91
+ return comosePathVal([center], Object.assign(Object.assign({}, options), { radius: radiusInMeters }));
92
+ }
93
+ return comosePathVal(path.coordinates, path.options || {});
94
+ });
95
+ return createMultiCollection("path", pathQueries);
96
+ }
97
+ //# sourceMappingURL=createPathQuery.js.map
@@ -0,0 +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,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AE,MAAM,EAAE,cAAc,IAAG,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"]}
@@ -0,0 +1,74 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { createMultiCollection } from "./createMultiCollection";
4
+ const optionKeyMap = {
5
+ opacity: "al",
6
+ labelAnchor: "la",
7
+ labelColor: "lc",
8
+ labelSizeInPixels: "ls",
9
+ pinAnchor: "an",
10
+ rotationInDegree: "ro",
11
+ scale: "sc",
12
+ pinColor: "co",
13
+ };
14
+ function isOptionKeyMap(key) {
15
+ return key in optionKeyMap;
16
+ }
17
+ /**
18
+ * Create a pin query string for _get map static image_
19
+ *
20
+ * @example
21
+ * ```ts
22
+ *
23
+ * const pins = {
24
+ * pins: [
25
+ * { coordinate: [52.577, 13.35], label: "Label start" },
26
+ * { coordinate: [52.6, 13.2988], label: "Label end" },
27
+ * ],
28
+ * pinImage: "<image source url || default || none>"
29
+ * options: {
30
+ * scale: 0.9,
31
+ * pinColor: "FF0000",
32
+ * labelColor: "0000FF",
33
+ * labelSizeInPixels: 18,
34
+ * }
35
+ * );
36
+ * const res = await client
37
+ * .path("/map/static/{format}", "png")
38
+ * .get({
39
+ * queryParameters: {
40
+ * bbox: [13.228, 52.4559, 13.5794, 52.62],
41
+ * zoom: 10,
42
+ * pins: pins,
43
+ * },
44
+ * skipUrlEncoding: true,
45
+ * })
46
+ * ```
47
+ *
48
+ * @param pins - An array of {@link Pin} that specify the positions and label text of each pin.
49
+ * @param pinImage - Specify the image source for custom pin. Set this to "none" if you don't want to show a pin image.
50
+ * @param options - The style options of the pins. See {@link PinOptions}
51
+ * @returns - The composed query string.
52
+ */
53
+ export function createPinsQuery(pinSets) {
54
+ const pinsQueries = pinSets.map(({ pins, pinImage = "default", options = {} }) => {
55
+ // compose the pins' position query string
56
+ const pinsQueryStr = pins
57
+ .map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : ""}${lon} ${lat}`)
58
+ .join("|");
59
+ // compose the options query string
60
+ const optionsQueryStr = Object.entries(options).reduce((queryStr, [key, val]) => {
61
+ if (!isOptionKeyMap(key))
62
+ throw Error(`Unexpected option: ${key}`);
63
+ if (Array.isArray(val))
64
+ return (queryStr += `|${optionKeyMap[key]}${val[0]} ${val[1]}`);
65
+ return (queryStr += `|${optionKeyMap[key]}${val}`);
66
+ }, "");
67
+ if (pinImage === "none" || pinImage === "default") {
68
+ return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;
69
+ }
70
+ return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;
71
+ });
72
+ return createMultiCollection("pins", pinsQueries);
73
+ }
74
+ //# sourceMappingURL=createPinsQuery.js.map
@@ -0,0 +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,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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poration.\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"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=clientDefinitions.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,11 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import MapsRenderClient from "./mapsRenderClient";
4
+ export * from "./mapsRenderClient";
5
+ export * from "./parameters";
6
+ export * from "./responses";
7
+ export * from "./clientDefinitions";
8
+ export * from "./isUnexpected";
9
+ export * from "./outputModels";
10
+ export default MapsRenderClient;
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAE/B,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport MapsRenderClient from \"./mapsRenderClient\";\n\nexport * from \"./mapsRenderClient\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./outputModels\";\n\nexport default MapsRenderClient;\n"]}
@@ -0,0 +1,77 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ const responseMap = {
4
+ "GET /map/tile": ["200"],
5
+ "GET /map/tileset": ["200"],
6
+ "GET /map/attribution": ["200"],
7
+ "GET /map/statetile": ["200"],
8
+ "GET /map/copyright/caption/{format}": ["200"],
9
+ "GET /map/static/{format}": ["200"],
10
+ "GET /map/copyright/bounding/{format}": ["200"],
11
+ "GET /map/copyright/tile/{format}": ["200"],
12
+ "GET /map/copyright/world/{format}": ["200"]
13
+ };
14
+ export function isUnexpected(response) {
15
+ const lroOriginal = response.headers["x-ms-original-url"];
16
+ const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
17
+ const method = response.request.method;
18
+ let pathDetails = responseMap[`${method} ${url.pathname}`];
19
+ if (!pathDetails) {
20
+ pathDetails = geParametrizedPathSuccess(method, url.pathname);
21
+ }
22
+ return !pathDetails.includes(response.status);
23
+ }
24
+ function geParametrizedPathSuccess(method, path) {
25
+ var _a, _b;
26
+ const pathParts = path.split("/");
27
+ // Iterate the responseMap to find a match
28
+ for (const [key, value] of Object.entries(responseMap)) {
29
+ // Extracting the path from the map key which is in format
30
+ // GET /path/foo
31
+ if (!key.startsWith(method)) {
32
+ continue;
33
+ }
34
+ const candidatePath = getPathFromMapKey(key);
35
+ // Get each part of the url path
36
+ const candidateParts = candidatePath.split("/");
37
+ // If the candidate and actual paths don't match in size
38
+ // we move on to the next candidate path
39
+ if (candidateParts.length === pathParts.length &&
40
+ hasParametrizedPath(key)) {
41
+ // track if we have found a match to return the values found.
42
+ let found = true;
43
+ for (let i = 0; i < candidateParts.length; i++) {
44
+ if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
45
+ ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.endsWith("}"))) {
46
+ // If the current part of the candidate is a "template" part
47
+ // it is a match with the actual path part on hand
48
+ // skip as the parameterized part can match anything
49
+ continue;
50
+ }
51
+ // If the candidate part is not a template and
52
+ // the parts don't match mark the candidate as not found
53
+ // to move on with the next candidate path.
54
+ if (candidateParts[i] !== pathParts[i]) {
55
+ found = false;
56
+ break;
57
+ }
58
+ }
59
+ // We finished evaluating the current candidate parts
60
+ // if all parts matched we return the success values form
61
+ // the path mapping.
62
+ if (found) {
63
+ return value;
64
+ }
65
+ }
66
+ }
67
+ // No match was found, return an empty array.
68
+ return [];
69
+ }
70
+ function hasParametrizedPath(path) {
71
+ return path.includes("/{");
72
+ }
73
+ function getPathFromMapKey(mapKey) {
74
+ const pathStart = mapKey.indexOf("/");
75
+ return mapKey.slice(pathStart);
76
+ }
77
+ //# sourceMappingURL=isUnexpected.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAuBlC,MAAM,WAAW,GAA6B;IAC5C,eAAe,EAAE,CAAC,KAAK,CAAC;IACxB,kBAAkB,EAAE,CAAC,KAAK,CAAC;IAC3B,sBAAsB,EAAE,CAAC,KAAK,CAAC;IAC/B,oBAAoB,EAAE,CAAC,KAAK,CAAC;IAC7B,qCAAqC,EAAE,CAAC,KAAK,CAAC;IAC9C,0BAA0B,EAAE,CAAC,KAAK,CAAC;IACnC,sCAAsC,EAAE,CAAC,KAAK,CAAC;IAC/C,kCAAkC,EAAE,CAAC,KAAK,CAAC;IAC3C,mCAAmC,EAAE,CAAC,KAAK,CAAC;CAC7C,CAAC;AA2CF,MAAM,UAAU,YAAY,CAC1B,QAkB6C;IAW7C,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,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ACA,4DAA4D;oBAC5D,kDAAkD;oBAClD,oDAAoD;oBACpD,SAAS;iBACV;gBAED,8CAA8C;gBAC9C,wDAAwD;gBACxD,2CAA2C;gBAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;oBACtC,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;aACF;YAED,qDAAqD;YACrD,yDAAyD;YACzD,oBAAoB;YACpB,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,6CAA6C;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// 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"]}
@@ -0,0 +1,25 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { getClient } from "@azure-rest/core-client";
4
+ /**
5
+ * Initialize a new instance of the class MapsRenderClient class.
6
+ * @param credentials type: KeyCredential
7
+ */
8
+ export default function createClient(credentials, options = {}) {
9
+ var _a, _b;
10
+ const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `https://atlas.microsoft.com`;
11
+ options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2022-08-01";
12
+ options = Object.assign(Object.assign({}, options), { credentials: {
13
+ apiKeyHeaderName: "subscription-key"
14
+ } });
15
+ const userAgentInfo = `azsdk-js-maps-render-rest/1.0.0-beta.1`;
16
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
17
+ ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
18
+ : `${userAgentInfo}`;
19
+ options = Object.assign(Object.assign({}, options), { userAgentOptions: {
20
+ userAgentPrefix
21
+ } });
22
+ const client = getClient(baseUrl, credentials, options);
23
+ return client;
24
+ }
25
+ //# sourceMappingURL=mapsRenderClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapsRenderClient.js","sourceRoot":"","sources":["../../../src/generated/mapsRenderClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AAInE;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA0B,EAC1B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,6BAA6B,CAAC;IACjE,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,YAAY,CAAC;IACxD,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,gBAAgB,EAAE,kBAAkB;SACrC,GACF,CAAC;IAEF,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAC/D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAqB,CAAC;IAE5E,OAAO,MAAM,CAAC;AAChB,CAAC","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.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"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=outputModels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../../src/generated/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */\nexport interface ErrorResponseOutput {\n /** The error object. */\n error?: ErrorDetailOutput;\n}\n\n/** The error detail. */\nexport interface ErrorDetailOutput {\n /** The error code. */\n code?: string;\n /** The error message. */\n message?: string;\n /** The error target. */\n target?: string;\n /** The error details. */\n details?: Array<ErrorDetailOutput>;\n /** The error additional info. */\n additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n type?: string;\n /** The additional info. */\n info?: Record<string, unknown>;\n}\n\n/** Metadata for a tileset in the TileJSON format. */\nexport interface MapTilesetOutput {\n /** Describes the version of the TileJSON spec that is implemented by this JSON object. */\n tilejson: string;\n /** A name describing the tileset. The name can contain any legal character. Implementations SHOULD NOT interpret the name as HTML. */\n name?: string;\n /** Text description of the tileset. The description can contain any legal character. Implementations SHOULD NOT interpret the description as HTML. */\n description?: string;\n /** A semver.org style version number for the tiles contained within the tileset. When changes across tiles are introduced, the minor version MUST change. */\n version?: string;\n /** Copyright attribution to be displayed on the map. Implementations MAY decide to treat this as HTML or literal text. For security reasons, make absolutely sure that this field can't be abused as a vector for XSS or beacon tracking. */\n attribution?: string;\n /** A mustache template to be used to format data from grids for interaction. */\n template?: string;\n /** A legend to be displayed with the map. Implementations MAY decide to treat this as HTML or literal text. For security reasons, make absolutely sure that this field can't be abused as a vector for XSS or beacon tracking. */\n legend?: string;\n /** Default: \"xyz\". Either \"xyz\" or \"tms\". Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed. */\n scheme?: string;\n /** An array of tile endpoints. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoints MUST return the same content for the same URL. The array MUST contain at least one endpoint. */\n tiles: Array<string>;\n /** An array of interactivity endpoints. */\n grids?: Array<string>;\n /** An array of data files in GeoJSON format. */\n data?: Array<string>;\n /** The minimum zoom level. */\n minzoom?: number;\n /** The maximum zoom level. */\n maxzoom?: number;\n /** The maximum extent of available map tiles. Bounds MUST define an area covered by all zoom levels. The bounds are represented in WGS:84 latitude and longitude values, in the order left, bottom, right, top. Values may be integers or floating point numbers. */\n bounds?: Array<number>;\n /** The default location of the tileset in the form [longitude, latitude, zoom]. The zoom level MUST be between minzoom and maxzoom. Implementations can use this value to set the default location. */\n center?: Array<number>;\n}\n\n/** Copyright attribution for the requested section of a tileset. */\nexport interface MapAttributionOutput {\n /** A list of copyright strings. */\n copyrights: Array<string>;\n}\n\n/** This object is returned from a successful copyright call */\nexport interface CopyrightCaptionOutput {\n /** Format Version property */\n formatVersion?: string;\n /** Copyrights Caption property */\n copyrightsCaption: string;\n}\n\n/** This object is returned from a successful copyright request */\nexport interface CopyrightOutput {\n /** Format Version property */\n formatVersion?: string;\n /** General Copyrights array */\n generalCopyrights?: Array<string>;\n /** Regions array */\n regions?: Array<RegionCopyrightsOutput>;\n}\n\nexport interface RegionCopyrightsOutput {\n /** Copyrights array */\n copyrights: Array<string>;\n /** Country property */\n country: RegionCopyrightsCountryOutput;\n}\n\n/** Country property */\nexport interface RegionCopyrightsCountryOutput {\n /** ISO3 property */\n ISO3: string;\n /** Label property */\n label: string;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/generated/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\n\nexport interface RenderGetMapTileQueryParamProperties {\n /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */\n tilesetId:\n | \"microsoft.base\"\n | \"microsoft.base.labels\"\n | \"microsoft.base.hybrid\"\n | \"microsoft.terra.main\"\n | \"microsoft.base.road\"\n | \"microsoft.base.darkgrey\"\n | \"microsoft.base.labels.road\"\n | \"microsoft.base.labels.darkgrey\"\n | \"microsoft.base.hybrid.road\"\n | \"microsoft.base.hybrid.darkgrey\"\n | \"microsoft.imagery\"\n | \"microsoft.weather.radar.main\"\n | \"microsoft.weather.infrared.main\"\n | \"microsoft.dem\"\n | \"microsoft.dem.contours\"\n | \"microsoft.traffic.absolute\"\n | \"microsoft.traffic.absolute.main\"\n | \"microsoft.traffic.relative\"\n | \"microsoft.traffic.relative.main\"\n | \"microsoft.traffic.relative.dark\"\n | \"microsoft.traffic.delay\"\n | \"microsoft.traffic.delay.main\"\n | \"microsoft.traffic.reduced.main\"\n | \"microsoft.traffic.incident\";\n /**\n * Zoom level for the desired tile.\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n zoom: number;\n /**\n * X coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n x: number;\n /**\n * Y coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n y: number;\n /**\n * The desired date and time of the requested tile. This parameter must be specified in the standard date-time format (e.g. 2019-11-14T16:03:00-08:00), as defined by [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). This parameter is only supported when tilesetId parameter is set to one of the values below.\n *\n * * microsoft.weather.infrared.main: We provide tiles up to 3 hours in the past. Tiles are available in 10-minute intervals. We round the timeStamp value to the nearest 10-minute time frame.\n * * microsoft.weather.radar.main: We provide tiles up to 1.5 hours in the past and up to 2 hours in the future. Tiles are available in 5-minute intervals. We round the timeStamp value to the nearest 5-minute time frame.\n */\n timeStamp?: Date | string;\n /** The size of the returned map tile in pixels. */\n tileSize?: \"256\" | \"512\";\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n}\n\nexport interface RenderGetMapTileQueryParam {\n queryParameters: RenderGetMapTileQueryParamProperties;\n}\n\nexport type RenderGetMapTileParameters = RenderGetMapTileQueryParam &\n RequestParameters;\n\nexport interface RenderGetMapTilesetQueryParamProperties {\n /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */\n tilesetId:\n | \"microsoft.base\"\n | \"microsoft.base.labels\"\n | \"microsoft.base.hybrid\"\n | \"microsoft.terra.main\"\n | \"microsoft.base.road\"\n | \"microsoft.base.darkgrey\"\n | \"microsoft.base.labels.road\"\n | \"microsoft.base.labels.darkgrey\"\n | \"microsoft.base.hybrid.road\"\n | \"microsoft.base.hybrid.darkgrey\"\n | \"microsoft.imagery\"\n | \"microsoft.weather.radar.main\"\n | \"microsoft.weather.infrared.main\"\n | \"microsoft.dem\"\n | \"microsoft.dem.contours\"\n | \"microsoft.traffic.absolute\"\n | \"microsoft.traffic.absolute.main\"\n | \"microsoft.traffic.relative\"\n | \"microsoft.traffic.relative.main\"\n | \"microsoft.traffic.relative.dark\"\n | \"microsoft.traffic.delay\"\n | \"microsoft.traffic.delay.main\"\n | \"microsoft.traffic.reduced.main\"\n | \"microsoft.traffic.incident\";\n}\n\nexport interface RenderGetMapTilesetQueryParam {\n queryParameters: RenderGetMapTilesetQueryParamProperties;\n}\n\nexport type RenderGetMapTilesetParameters = RenderGetMapTilesetQueryParam &\n RequestParameters;\n\nexport interface RenderGetMapAttributionQueryParamProperties {\n /** A tileset is a collection of raster or vector data broken up into a uniform grid of square tiles at preset zoom levels. Every tileset has a **tilesetId** to use when making requests. The **tilesetId** for tilesets created using [Azure Maps Creator](https://aka.ms/amcreator) are generated through the [Tileset Create API](https://docs.microsoft.com/en-us/rest/api/maps/tileset). The ready-to-use tilesets supplied by Azure Maps are listed below. For example, microsoft.base. */\n tilesetId:\n | \"microsoft.base\"\n | \"microsoft.base.labels\"\n | \"microsoft.base.hybrid\"\n | \"microsoft.terra.main\"\n | \"microsoft.base.road\"\n | \"microsoft.base.darkgrey\"\n | \"microsoft.base.labels.road\"\n | \"microsoft.base.labels.darkgrey\"\n | \"microsoft.base.hybrid.road\"\n | \"microsoft.base.hybrid.darkgrey\"\n | \"microsoft.imagery\"\n | \"microsoft.weather.radar.main\"\n | \"microsoft.weather.infrared.main\"\n | \"microsoft.dem\"\n | \"microsoft.dem.contours\"\n | \"microsoft.traffic.absolute\"\n | \"microsoft.traffic.absolute.main\"\n | \"microsoft.traffic.relative\"\n | \"microsoft.traffic.relative.main\"\n | \"microsoft.traffic.relative.dark\"\n | \"microsoft.traffic.delay\"\n | \"microsoft.traffic.delay.main\"\n | \"microsoft.traffic.reduced.main\"\n | \"microsoft.traffic.incident\";\n /** Zoom level for the desired map attribution. */\n zoom: number;\n /** The string that represents the rectangular area of a bounding box. The bounds parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The string is presented in the following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]`. */\n bounds: Array<number>;\n}\n\nexport interface RenderGetMapAttributionQueryParam {\n queryParameters: RenderGetMapAttributionQueryParamProperties;\n}\n\nexport type RenderGetMapAttributionParameters = RenderGetMapAttributionQueryParam &\n RequestParameters;\n\nexport interface RenderGetMapStateTileQueryParamProperties {\n /**\n * Zoom level for the desired tile.\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n zoom: number;\n /**\n * X coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n x: number;\n /**\n * Y coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n y: number;\n /** The stateset id. */\n statesetId: string;\n}\n\nexport interface RenderGetMapStateTileQueryParam {\n queryParameters: RenderGetMapStateTileQueryParamProperties;\n}\n\nexport type RenderGetMapStateTileParameters = RenderGetMapStateTileQueryParam &\n RequestParameters;\nexport type RenderGetCopyrightCaptionParameters = RequestParameters;\n\nexport interface RenderGetMapStaticImageQueryParamProperties {\n /** Map layer requested. If layer is set to labels or hybrid, the format should be png. */\n layer?: \"basic\" | \"hybrid\" | \"labels\";\n /** Map style to be returned. Possible values are main and dark. */\n style?: \"main\" | \"dark\";\n /** Desired zoom level of the map. Zoom value must be in the range: 0-20 (inclusive). Default value is 12.<br><br>Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details. */\n zoom?: number;\n /**\n * Coordinates of the center point. Format: 'lon,lat'. Projection used\n * - EPSG:3857. Longitude range: -180 to 180. Latitude range: -85 to 85.\n *\n * Note: Either center or bbox are required parameters. They are\n * mutually exclusive.\n */\n center?: Array<number>;\n /**\n * Bounding box. Projection used - EPSG:3857. Format : 'minLon, minLat,\n * maxLon, maxLat'.\n *\n * Note: Either bbox or center are required\n * parameters. They are mutually exclusive. It shouldn’t be used with\n * height or width.\n *\n * The maximum allowed ranges for Lat and Lon are defined for each zoom level\n * in the table at the top of this page.\n */\n bbox?: Array<number>;\n /**\n * Height of the resulting image in pixels. Range is 1 to 8192. Default\n * is 512. It shouldn’t be used with bbox.\n */\n height?: number;\n /** Width of the resulting image in pixels. Range is 1 to 8192. Default is 512. It shouldn’t be used with bbox. */\n width?: number;\n /**\n * Language in which search results should be returned. Should be one of supported IETF language tags, case insensitive. When data in specified language is not available for a specific field, default language is used.\n *\n * Please refer to [Supported Languages](https://docs.microsoft.com/azure/azure-maps/supported-languages) for details.\n */\n language?: string;\n /**\n * The View parameter (also called the \"user region\" parameter) allows you to show the correct maps for a certain country/region for geopolitically disputed regions. Different countries/regions have different views of such regions, and the View parameter allows your application to comply with the view required by the country/region your application will be serving. By default, the View parameter is set to “Unified” even if you haven’t defined it in the request. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. Alternatively, you have the option to set ‘View=Auto’, which will return the map data based on the IP address of the request. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country/region where maps, images and other data and third party content that you are authorized to access via Azure Maps is made available. Example: view=IN.\n *\n * Please refer to [Supported Views](https://aka.ms/AzureMapsLocalizationViews) for details and to see the available Views.\n */\n view?:\n | \"AE\"\n | \"AR\"\n | \"BH\"\n | \"IN\"\n | \"IQ\"\n | \"JO\"\n | \"KW\"\n | \"LB\"\n | \"MA\"\n | \"OM\"\n | \"PK\"\n | \"PS\"\n | \"QA\"\n | \"SA\"\n | \"SY\"\n | \"YE\"\n | \"Auto\"\n | \"Unified\";\n /**\n * Pushpin style and instances. Use this parameter to optionally add pushpins to the image.\n * The pushpin style describes the appearance of the pushpins, and the instances specify\n * the coordinates of the pushpins and optional labels for each pin. (Be sure to properly URL-encode values of this\n * parameter since it will contain reserved characters such as pipes and punctuation.)\n *\n * The Azure Maps account S0 SKU only supports a single instance of the pins parameter. Other SKUs\n * allow multiple instances of the pins parameter to specify multiple pin styles.\n *\n * To render a pushpin at latitude 45°N and longitude 122°W using the default built-in pushpin style, add the\n * querystring parameter\n *\n * `pins=default||-122 45`\n *\n * Note that the longitude comes before the latitude.\n * After URL encoding this will look like\n *\n * `pins=default%7C%7C-122+45`\n *\n * All of the examples here show the pins\n * parameter without URL encoding, for clarity.\n *\n * To render a pin at multiple locations, separate each location with a pipe character. For example, use\n *\n * `pins=default||-122 45|-119.5 43.2|-121.67 47.12`\n *\n * The S0 Azure Maps account SKU only allows five pushpins. Other account SKUs do not have this limitation.\n *\n * ### Style Modifiers\n *\n * You can modify the appearance of the pins by adding style modifiers. These are added after the style but before\n * the locations and labels. Style modifiers each have a two-letter name. These abbreviated names are used to help\n * reduce the length of the URL.\n *\n * To change the color of the pushpin, use the 'co' style modifier and specify the color using the HTML/CSS RGB color\n * format which is a six-digit hexadecimal number (the three-digit form is not supported). For example, to use\n * a deep pink color which you would specify as #FF1493 in CSS, use\n *\n * `pins=default|coFF1493||-122 45`\n *\n * ### Pushpin Labels\n *\n * To add a label to the pins, put the label in single quotes just before the coordinates. For example, to label\n * three pins with the values '1', '2', and '3', use\n *\n * `pins=default||'1'-122 45|'2'-119.5 43.2|'3'-121.67 47.12`\n *\n * There is a built in pushpin style called 'none' that does not display a pushpin image. You can use this if\n * you want to display labels without any pin image. For example,\n *\n * `pins=none||'A'-122 45|'B'-119.5 43.2`\n *\n * To change the color of the pushpin labels, use the 'lc' label color style modifier. For example, to use pink\n * pushpins with black labels, use\n *\n * `pins=default|coFF1493|lc000000||-122 45`\n *\n * To change the size of the labels, use the 'ls' label size style modifier. The label size represents the approximate\n * height of the label text in pixels. For example, to increase the label size to 12, use\n *\n * `pins=default|ls12||'A'-122 45|'B'-119 43`\n *\n * The labels are centered at the pushpin 'label anchor.' The anchor location is predefined for built-in pushpins and\n * is at the top center of custom pushpins (see below). To override the label anchor, using the 'la' style modifier\n * and provide X and Y pixel coordinates for the anchor. These coordinates are relative to the top left corner of the\n * pushpin image. Positive X values move the anchor to the right, and positive Y values move the anchor down. For example,\n * to position the label anchor 10 pixels right and 4 pixels above the top left corner of the pushpin image,\n * use\n *\n * `pins=default|la10 -4||'A'-122 45|'B'-119 43`\n *\n * ### Custom Pushpins\n *\n * To use a custom pushpin image, use the word 'custom' as the pin style name, and then specify a URL after the\n * location and label information. Use two pipe characters to indicate that you're done specifying locations and are\n * starting the URL. For example,\n *\n * `pins=custom||-122 45||http://contoso.com/pushpins/red.png`\n *\n * After URL encoding, this would look like\n *\n * `pins=custom%7C%7C-122+45%7C%7Chttp%3A%2F%2Fcontoso.com%2Fpushpins%2Fred.png`\n *\n * By default, custom pushpin images are drawn centered at the pin coordinates. This usually isn't ideal as it obscures\n * the location that you're trying to highlight. To override the anchor location of the pin image, use the 'an'\n * style modifier. This uses the same format as the 'la' label anchor style modifier. For example, if your custom\n * 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\n * using\n *\n * `pins=custom|an0 0||-122 45||http://contoso.com/pushpins/red.png`\n *\n * Note: If you use the 'co' color modifier with a custom pushpin image, the specified color will replace the RGB\n * channels of the pixels in the image but will leave the alpha (opacity) channel unchanged. This would usually\n * only be done with a solid-color custom image.\n *\n * ### Scale, Rotation, and Opacity\n *\n * You can make pushpins and their labels larger or smaller by using the 'sc' scale style modifier. This is a\n * value greater than zero. A value of 1 is the standard scale. Values larger than 1 will make the pins larger, and\n * values smaller than 1 will make them smaller. For example, to draw the pushpins 50% larger than normal, use\n *\n * `pins=default|sc1.5||-122 45`\n *\n * You can rotate pushpins and their labels by using the 'ro' rotation style modifier. This is a number of degrees\n * of clockwise rotation. Use a negative number to rotate counter-clockwise. For example, to rotate the pushpins\n * 90 degrees clockwise and double their size, use\n *\n * `pins=default|ro90|sc2||-122 45`\n *\n * You can make pushpins and their labels partially transparent by specifying the 'al' alpha style modifier.\n * This is a number between 0 and 1 indicating the opacity of the pushpins. Zero makes them completely transparent\n * (and not visible) and 1 makes them completely opaque (which is the default). For example, to make pushpins\n * and their labels only 67% opaque, use\n *\n * `pins=default|al.67||-122 45`\n *\n * ### Style Modifier Summary\n *\n * Modifier | Description | Range\n * :--------:|-----------------|------------------\n * al | Alpha (opacity) | 0 to 1\n * an | Pin anchor | *\n * co | Pin color | 000000 to FFFFFF\n * la | Label anchor | *\n * lc | Label color | 000000 to FFFFFF\n * ls | Label size | Greater than 0\n * ro | Rotation | -360 to 360\n * sc | Scale | Greater than 0\n *\n * * X and Y coordinates can be anywhere within pin image or a margin around it.\n * The margin size is the minimum of the pin width and height.\n */\n pins?: string;\n /**\n * Path style and locations. Use this parameter to optionally add lines, polygons or circles to the image.\n * The path style describes the appearance of the line and fill. (Be sure to properly URL-encode values of this\n * parameter since it will contain reserved characters such as pipes and punctuation.)\n *\n * Path parameter is supported in Azure Maps account SKU starting with S1. Multiple instances of the path parameter\n * allow to specify multiple geometries with their styles. Number of parameters per request is limited to 10 and\n * number of locations is limited to 100 per path.\n *\n * To render a circle with radius 100 meters and center point at latitude 45°N and longitude 122°W using the default style, add the\n * querystring parameter\n *\n * `path=ra100||-122 45`\n *\n * Note that the longitude comes before the latitude.\n * After URL encoding this will look like\n *\n * `path=ra100%7C%7C-122+45`\n *\n * All of the examples here show the path parameter without URL encoding, for clarity.\n *\n * To render a line, separate each location with a pipe character. For example, use\n *\n * `path=||-122 45|-119.5 43.2|-121.67 47.12`\n *\n * To render a polygon, last location must be equal to the start location. For example, use\n *\n * `path=||-122 45|-119.5 43.2|-121.67 47.12|-122 45`\n *\n * Longitude and latitude values for locations of lines and polygons can be in the range from -360 to 360 to allow for rendering of geometries crossing the anti-meridian.\n *\n * ### Style Modifiers\n *\n * You can modify the appearance of the path by adding style modifiers. These are added before the locations.\n * Style modifiers each have a two-letter name. These abbreviated names are used to help reduce the length\n * of the URL.\n *\n * To change the color of the outline, use the 'lc' style modifier and specify the color using the HTML/CSS RGB color\n * format which is a six-digit hexadecimal number (the three-digit form is not supported). For example, to use\n * a deep pink color which you would specify as #FF1493 in CSS, use\n *\n * `path=lcFF1493||-122 45|-119.5 43.2`\n *\n * Multiple style modifiers may be combined together to create a more complex visual style.\n *\n * `lc0000FF|lw3|la0.60|fa0.50||-122.2 47.6|-122.2 47.7|-122.3 47.7|-122.3 47.6|-122.2 47.6`\n *\n * ### Style Modifier Summary\n *\n * Modifier | Description | Range\n * :--------:|------------------------|------------------\n * lc | Line color | 000000 to FFFFFF\n * fc | Fill color | 000000 to FFFFFF\n * la | Line alpha (opacity) | 0 to 1\n * fa | Fill alpha (opacity) | 0 to 1\n * lw | Line width | Greater than 0\n * ra | Circle radius (meters) | Greater than 0\n */\n path?: string;\n}\n\nexport interface RenderGetMapStaticImageQueryParam {\n queryParameters?: RenderGetMapStaticImageQueryParamProperties;\n}\n\nexport type RenderGetMapStaticImageParameters = RenderGetMapStaticImageQueryParam &\n RequestParameters;\n\nexport interface RenderGetCopyrightFromBoundingBoxQueryParamProperties {\n /** Minimum coordinates (south-west point) of bounding box in latitude longitude coordinate system. E.g. 52.41064,4.84228 */\n mincoordinates: Array<number>;\n /** Maximum coordinates (north-east point) of bounding box in latitude longitude coordinate system. E.g. 52.41064,4.84228 */\n maxcoordinates: Array<number>;\n /** Yes/no value to exclude textual data from response. Only images and country/region names will be in response. */\n text?: \"yes\" | \"no\";\n}\n\nexport interface RenderGetCopyrightFromBoundingBoxQueryParam {\n queryParameters: RenderGetCopyrightFromBoundingBoxQueryParamProperties;\n}\n\nexport type RenderGetCopyrightFromBoundingBoxParameters = RenderGetCopyrightFromBoundingBoxQueryParam &\n RequestParameters;\n\nexport interface RenderGetCopyrightForTileQueryParamProperties {\n /**\n * Zoom level for the desired tile.\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/en-us/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n zoom: number;\n /**\n * X coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n x: number;\n /**\n * Y coordinate of the tile on zoom grid. Value must be in the range [0, 2<sup>`zoom`</sup> -1].\n *\n * Please see [Zoom Levels and Tile Grid](https://docs.microsoft.com/azure/location-based-services/zoom-levels-and-tile-grid) for details.\n */\n y: number;\n /** Yes/no value to exclude textual data from response. Only images and country/region names will be in response. */\n text?: \"yes\" | \"no\";\n}\n\nexport interface RenderGetCopyrightForTileQueryParam {\n queryParameters: RenderGetCopyrightForTileQueryParamProperties;\n}\n\nexport type RenderGetCopyrightForTileParameters = RenderGetCopyrightForTileQueryParam &\n RequestParameters;\n\nexport interface RenderGetCopyrightForWorldQueryParamProperties {\n /** Yes/no value to exclude textual data from response. Only images and country/region names will be in response. */\n text?: \"yes\" | \"no\";\n}\n\nexport interface RenderGetCopyrightForWorldQueryParam {\n queryParameters?: RenderGetCopyrightForWorldQueryParamProperties;\n}\n\nexport type RenderGetCopyrightForWorldParameters = RenderGetCopyrightForWorldQueryParam &\n RequestParameters;\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=responses.js.map