@azure-rest/maps-render 2.0.0-beta.1 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -4
- package/README.md +48 -34
- package/dist/browser/createMultiCollection.d.ts +7 -0
- package/dist/browser/createMultiCollection.d.ts.map +1 -0
- package/dist/browser/createPathQuery.d.ts +117 -0
- package/dist/browser/createPathQuery.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/createPathQuery.js +41 -24
- package/dist/browser/createPathQuery.js.map +1 -0
- package/dist/browser/createPinsQuery.d.ts +102 -0
- package/dist/browser/createPinsQuery.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/createPinsQuery.js +44 -25
- package/dist/browser/createPinsQuery.js.map +1 -0
- package/dist/browser/generated/clientDefinitions.d.ts +131 -0
- package/dist/browser/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/generated/clientDefinitions.js +4 -0
- package/dist/browser/generated/clientDefinitions.js.map +1 -0
- package/dist/browser/generated/index.d.ts +9 -0
- package/dist/browser/generated/index.d.ts.map +1 -0
- package/dist/browser/generated/index.js +11 -0
- package/dist/browser/generated/index.js.map +1 -0
- package/dist/browser/generated/isUnexpected.d.ts +11 -0
- package/dist/browser/generated/isUnexpected.d.ts.map +1 -0
- package/dist/browser/generated/isUnexpected.js +79 -0
- package/dist/browser/generated/isUnexpected.js.map +1 -0
- package/dist/browser/generated/logger.d.ts +2 -0
- package/dist/browser/generated/logger.d.ts.map +1 -0
- package/dist/browser/generated/logger.js +5 -0
- package/dist/browser/generated/logger.js.map +1 -0
- package/dist/browser/generated/mapsRenderClient.d.ts +15 -0
- package/dist/browser/generated/mapsRenderClient.d.ts.map +1 -0
- package/dist/browser/generated/mapsRenderClient.js +42 -0
- package/dist/browser/generated/mapsRenderClient.js.map +1 -0
- package/dist/browser/generated/outputModels.d.ts +93 -0
- package/dist/browser/generated/outputModels.d.ts.map +1 -0
- package/dist/browser/generated/outputModels.js +4 -0
- package/dist/browser/generated/outputModels.js.map +1 -0
- package/dist/browser/generated/parameters.d.ts +384 -0
- package/dist/browser/generated/parameters.d.ts.map +1 -0
- package/dist/browser/generated/parameters.js +4 -0
- package/dist/browser/generated/parameters.js.map +1 -0
- package/dist/browser/generated/responses.d.ts +248 -0
- package/dist/browser/generated/responses.d.ts.map +1 -0
- package/dist/browser/generated/responses.js +4 -0
- package/dist/browser/generated/responses.js.map +1 -0
- package/dist/browser/index.d.ts +7 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +9 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/mapsRender.d.ts +53 -0
- package/dist/browser/mapsRender.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/mapsRender.js +1 -1
- package/dist/browser/mapsRender.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/positionToTileXY.d.ts +47 -0
- package/dist/browser/positionToTileXY.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/positionToTileXY.js +23 -2
- package/dist/browser/positionToTileXY.js.map +1 -0
- package/dist/commonjs/createMultiCollection.d.ts +7 -0
- package/dist/commonjs/createMultiCollection.d.ts.map +1 -0
- package/dist/commonjs/createMultiCollection.js +16 -0
- package/dist/commonjs/createMultiCollection.js.map +1 -0
- package/dist/commonjs/createPathQuery.d.ts +117 -0
- package/dist/commonjs/createPathQuery.d.ts.map +1 -0
- package/dist/commonjs/createPathQuery.js +117 -0
- package/dist/commonjs/createPathQuery.js.map +1 -0
- package/dist/commonjs/createPinsQuery.d.ts +102 -0
- package/dist/commonjs/createPinsQuery.d.ts.map +1 -0
- package/dist/commonjs/createPinsQuery.js +96 -0
- package/dist/commonjs/createPinsQuery.js.map +1 -0
- package/dist/commonjs/generated/clientDefinitions.d.ts +131 -0
- package/dist/commonjs/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/generated/clientDefinitions.js +5 -0
- package/dist/commonjs/generated/clientDefinitions.js.map +1 -0
- package/dist/commonjs/generated/index.d.ts +9 -0
- package/dist/commonjs/generated/index.d.ts.map +1 -0
- package/dist/commonjs/generated/index.js +14 -0
- package/dist/commonjs/generated/index.js.map +1 -0
- package/dist/commonjs/generated/isUnexpected.d.ts +11 -0
- package/dist/commonjs/generated/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/generated/isUnexpected.js +82 -0
- package/dist/commonjs/generated/isUnexpected.js.map +1 -0
- package/dist/commonjs/generated/logger.d.ts +2 -0
- package/dist/commonjs/generated/logger.d.ts.map +1 -0
- package/dist/commonjs/generated/logger.js +8 -0
- package/dist/commonjs/generated/logger.js.map +1 -0
- package/dist/commonjs/generated/mapsRenderClient.d.ts +15 -0
- package/dist/commonjs/generated/mapsRenderClient.d.ts.map +1 -0
- package/dist/commonjs/generated/mapsRenderClient.js +45 -0
- package/dist/commonjs/generated/mapsRenderClient.js.map +1 -0
- package/dist/commonjs/generated/outputModels.d.ts +93 -0
- package/dist/commonjs/generated/outputModels.d.ts.map +1 -0
- package/dist/commonjs/generated/outputModels.js +5 -0
- package/dist/commonjs/generated/outputModels.js.map +1 -0
- package/dist/commonjs/generated/parameters.d.ts +384 -0
- package/dist/commonjs/generated/parameters.d.ts.map +1 -0
- package/dist/commonjs/generated/parameters.js +5 -0
- package/dist/commonjs/generated/parameters.js.map +1 -0
- package/dist/commonjs/generated/responses.d.ts +248 -0
- package/dist/commonjs/generated/responses.d.ts.map +1 -0
- package/dist/commonjs/generated/responses.js +5 -0
- package/dist/commonjs/generated/responses.js.map +1 -0
- package/dist/commonjs/index.d.ts +7 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +12 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/mapsRender.d.ts +53 -0
- package/dist/commonjs/mapsRender.d.ts.map +1 -0
- package/dist/commonjs/mapsRender.js +44 -0
- package/dist/commonjs/mapsRender.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/positionToTileXY.d.ts +47 -0
- package/dist/commonjs/positionToTileXY.d.ts.map +1 -0
- package/dist/commonjs/positionToTileXY.js +68 -0
- package/dist/commonjs/positionToTileXY.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/createMultiCollection.d.ts +7 -0
- package/dist/esm/createMultiCollection.d.ts.map +1 -0
- package/dist/esm/createMultiCollection.js +13 -0
- package/dist/esm/createMultiCollection.js.map +1 -0
- package/dist/esm/createPathQuery.d.ts +117 -0
- package/dist/esm/createPathQuery.d.ts.map +1 -0
- package/dist/esm/createPathQuery.js +114 -0
- package/dist/esm/createPathQuery.js.map +1 -0
- package/dist/esm/createPinsQuery.d.ts +102 -0
- package/dist/esm/createPinsQuery.d.ts.map +1 -0
- package/dist/esm/createPinsQuery.js +93 -0
- package/dist/esm/createPinsQuery.js.map +1 -0
- package/dist/esm/generated/clientDefinitions.d.ts +131 -0
- package/dist/esm/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/generated/clientDefinitions.js +4 -0
- package/dist/esm/generated/clientDefinitions.js.map +1 -0
- package/dist/esm/generated/index.d.ts +9 -0
- package/dist/esm/generated/index.d.ts.map +1 -0
- package/dist/esm/generated/index.js +11 -0
- package/dist/esm/generated/index.js.map +1 -0
- package/dist/esm/generated/isUnexpected.d.ts +11 -0
- package/dist/esm/generated/isUnexpected.d.ts.map +1 -0
- package/dist/esm/generated/isUnexpected.js +79 -0
- package/dist/esm/generated/isUnexpected.js.map +1 -0
- package/dist/esm/generated/logger.d.ts +2 -0
- package/dist/esm/generated/logger.d.ts.map +1 -0
- package/dist/esm/generated/logger.js +5 -0
- package/dist/esm/generated/logger.js.map +1 -0
- package/dist/esm/generated/mapsRenderClient.d.ts +15 -0
- package/dist/esm/generated/mapsRenderClient.d.ts.map +1 -0
- package/dist/esm/generated/mapsRenderClient.js +42 -0
- package/dist/esm/generated/mapsRenderClient.js.map +1 -0
- package/dist/esm/generated/outputModels.d.ts +93 -0
- package/dist/esm/generated/outputModels.d.ts.map +1 -0
- package/dist/esm/generated/outputModels.js +4 -0
- package/dist/esm/generated/outputModels.js.map +1 -0
- package/dist/esm/generated/parameters.d.ts +384 -0
- package/dist/esm/generated/parameters.d.ts.map +1 -0
- package/dist/esm/generated/parameters.js +4 -0
- package/dist/esm/generated/parameters.js.map +1 -0
- package/dist/esm/generated/responses.d.ts +248 -0
- package/dist/esm/generated/responses.d.ts.map +1 -0
- package/dist/esm/generated/responses.js +4 -0
- package/dist/esm/generated/responses.js.map +1 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/mapsRender.d.ts +53 -0
- package/dist/esm/mapsRender.d.ts.map +1 -0
- package/dist/esm/mapsRender.js +40 -0
- package/dist/esm/mapsRender.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/positionToTileXY.d.ts +47 -0
- package/dist/esm/positionToTileXY.d.ts.map +1 -0
- package/dist/esm/positionToTileXY.js +65 -0
- package/dist/esm/positionToTileXY.js.map +1 -0
- package/dist/react-native/createMultiCollection.d.ts +7 -0
- package/dist/react-native/createMultiCollection.d.ts.map +1 -0
- package/dist/react-native/createMultiCollection.js +13 -0
- package/dist/react-native/createMultiCollection.js.map +1 -0
- package/dist/react-native/createPathQuery.d.ts +117 -0
- package/dist/react-native/createPathQuery.d.ts.map +1 -0
- package/dist/react-native/createPathQuery.js +114 -0
- package/dist/react-native/createPathQuery.js.map +1 -0
- package/dist/react-native/createPinsQuery.d.ts +102 -0
- package/dist/react-native/createPinsQuery.d.ts.map +1 -0
- package/dist/react-native/createPinsQuery.js +93 -0
- package/dist/react-native/createPinsQuery.js.map +1 -0
- package/dist/react-native/generated/clientDefinitions.d.ts +131 -0
- package/dist/react-native/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/generated/clientDefinitions.js +4 -0
- package/dist/react-native/generated/clientDefinitions.js.map +1 -0
- package/dist/react-native/generated/index.d.ts +9 -0
- package/dist/react-native/generated/index.d.ts.map +1 -0
- package/dist/react-native/generated/index.js +11 -0
- package/dist/react-native/generated/index.js.map +1 -0
- package/dist/react-native/generated/isUnexpected.d.ts +11 -0
- package/dist/react-native/generated/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/generated/isUnexpected.js +79 -0
- package/dist/react-native/generated/isUnexpected.js.map +1 -0
- package/dist/react-native/generated/logger.d.ts +2 -0
- package/dist/react-native/generated/logger.d.ts.map +1 -0
- package/dist/react-native/generated/logger.js +5 -0
- package/dist/react-native/generated/logger.js.map +1 -0
- package/dist/react-native/generated/mapsRenderClient.d.ts +15 -0
- package/dist/react-native/generated/mapsRenderClient.d.ts.map +1 -0
- package/dist/react-native/generated/mapsRenderClient.js +42 -0
- package/dist/react-native/generated/mapsRenderClient.js.map +1 -0
- package/dist/react-native/generated/outputModels.d.ts +93 -0
- package/dist/react-native/generated/outputModels.d.ts.map +1 -0
- package/dist/react-native/generated/outputModels.js +4 -0
- package/dist/react-native/generated/outputModels.js.map +1 -0
- package/dist/react-native/generated/parameters.d.ts +384 -0
- package/dist/react-native/generated/parameters.d.ts.map +1 -0
- package/dist/react-native/generated/parameters.js +4 -0
- package/dist/react-native/generated/parameters.js.map +1 -0
- package/dist/react-native/generated/responses.d.ts +248 -0
- package/dist/react-native/generated/responses.d.ts.map +1 -0
- package/dist/react-native/generated/responses.js +4 -0
- package/dist/react-native/generated/responses.js.map +1 -0
- package/dist/react-native/index.d.ts +7 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +9 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/mapsRender.d.ts +53 -0
- package/dist/react-native/mapsRender.d.ts.map +1 -0
- package/dist/react-native/mapsRender.js +40 -0
- package/dist/react-native/mapsRender.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/positionToTileXY.d.ts +47 -0
- package/dist/react-native/positionToTileXY.d.ts.map +1 -0
- package/dist/react-native/positionToTileXY.js +65 -0
- package/dist/react-native/positionToTileXY.js.map +1 -0
- package/package.json +73 -52
- package/dist/index.js +0 -404
- package/dist/index.js.map +0 -1
- package/dist-esm/src/createPathQuery.js.map +0 -1
- package/dist-esm/src/createPinsQuery.js.map +0 -1
- package/dist-esm/src/index.js +0 -9
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/mapsRender.js.map +0 -1
- package/dist-esm/src/positionToTileXY.js.map +0 -1
- package/review/maps-render.api.md +0 -564
- package/types/maps-render-rest.d.ts +0 -1212
- /package/{dist-esm/src → dist/browser}/createMultiCollection.js +0 -0
- /package/{dist-esm/src → dist/browser}/createMultiCollection.js.map +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { LatLon } from "@azure/maps-common";
|
|
2
|
+
/**
|
|
3
|
+
* The options that modify the style of a circular path.
|
|
4
|
+
*/
|
|
5
|
+
export interface CircularPathOptions {
|
|
6
|
+
/** The line color of the path. Range from 000000 to FFFFFF. */
|
|
7
|
+
lineColor?: string;
|
|
8
|
+
/** The line opacity of the path. Range from 0 to 1. */
|
|
9
|
+
lineOpacity?: number;
|
|
10
|
+
/** The line width of the line. Should be greater than 0. */
|
|
11
|
+
lineWidthInPixels?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The options that modify the style of a polygonal path.
|
|
15
|
+
*/
|
|
16
|
+
export interface PolygonalPathOptions extends CircularPathOptions {
|
|
17
|
+
/** 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.*/
|
|
18
|
+
fillColor?: string;
|
|
19
|
+
/** 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.*/
|
|
20
|
+
fillOpacity?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Specify a circular path.
|
|
24
|
+
*/
|
|
25
|
+
export interface CircularPath {
|
|
26
|
+
/** The center of the circular path. */
|
|
27
|
+
center: LatLon;
|
|
28
|
+
/** The radius of the circular path. */
|
|
29
|
+
radiusInMeters: number;
|
|
30
|
+
/** The options that modify the style of the circular path. */
|
|
31
|
+
options?: CircularPathOptions;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Specify a polygonal path.
|
|
35
|
+
*/
|
|
36
|
+
export interface PolygonalPath {
|
|
37
|
+
/** The coordinates of the polygonal path. The identical coordinate in the first & last position construct a closed polygon.*/
|
|
38
|
+
coordinates: LatLon[];
|
|
39
|
+
/** The options that modify the style of the polygonal path. */
|
|
40
|
+
options?: PolygonalPathOptions;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Create a path query string for _get map static image_ request.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts snippet:ReadmeSampleCreatePathQuery
|
|
47
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
48
|
+
* import MapsRender, { CircularPath, PolygonalPath, createPathQuery } from "@azure-rest/maps-render";
|
|
49
|
+
* import { createWriteStream } from "node:fs";
|
|
50
|
+
*
|
|
51
|
+
* const credential = new DefaultAzureCredential();
|
|
52
|
+
* const client = MapsRender(credential, "<maps-account-client-id>");
|
|
53
|
+
*
|
|
54
|
+
* const circularPath: CircularPath = {
|
|
55
|
+
* center: [52.4559, 13.228],
|
|
56
|
+
* radiusInMeters: 10000,
|
|
57
|
+
* options: {
|
|
58
|
+
* lineColor: "000000",
|
|
59
|
+
* lineOpacity: 0.9,
|
|
60
|
+
* lineWidthInPixels: 2,
|
|
61
|
+
* },
|
|
62
|
+
* };
|
|
63
|
+
*
|
|
64
|
+
* const linearPath: PolygonalPath = {
|
|
65
|
+
* coordinates: [
|
|
66
|
+
* [52.577, 13.35],
|
|
67
|
+
* [52.6, 13.2988],
|
|
68
|
+
* [52.32, 13.2988],
|
|
69
|
+
* ],
|
|
70
|
+
* options: {
|
|
71
|
+
* lineColor: "000000",
|
|
72
|
+
* lineOpacity: 0.9,
|
|
73
|
+
* lineWidthInPixels: 2,
|
|
74
|
+
* },
|
|
75
|
+
* };
|
|
76
|
+
*
|
|
77
|
+
* const polygonPath: PolygonalPath = {
|
|
78
|
+
* coordinates: [
|
|
79
|
+
* [52.577, 13.35],
|
|
80
|
+
* [52.6, 13.2988],
|
|
81
|
+
* [52.32, 13.2988],
|
|
82
|
+
* [52.577, 13.35],
|
|
83
|
+
* ],
|
|
84
|
+
* options: {
|
|
85
|
+
* lineColor: "000000",
|
|
86
|
+
* lineOpacity: 0.9,
|
|
87
|
+
* lineWidthInPixels: 2,
|
|
88
|
+
* fillColor: "FFFFFF",
|
|
89
|
+
* fillOpacity: 0.8,
|
|
90
|
+
* },
|
|
91
|
+
* };
|
|
92
|
+
*
|
|
93
|
+
* const path = createPathQuery([circularPath, linearPath, polygonPath]);
|
|
94
|
+
* // Send the request
|
|
95
|
+
* const response = await client
|
|
96
|
+
* .path("/map/static")
|
|
97
|
+
* .get({
|
|
98
|
+
* queryParameters: {
|
|
99
|
+
* bbox: [13.228, 52.4559, 13.5794, 52.629],
|
|
100
|
+
* path,
|
|
101
|
+
* },
|
|
102
|
+
* })
|
|
103
|
+
* .asNodeStream();
|
|
104
|
+
*
|
|
105
|
+
* // Handle the error.
|
|
106
|
+
* if (!response.body) {
|
|
107
|
+
* throw Error("No response body");
|
|
108
|
+
* }
|
|
109
|
+
*
|
|
110
|
+
* response.body.pipe(createWriteStream("path.png"));
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.
|
|
114
|
+
* @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.
|
|
115
|
+
*/
|
|
116
|
+
export declare function createPathQuery(paths: Array<PolygonalPath | CircularPath>): string;
|
|
117
|
+
//# sourceMappingURL=createPathQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPathQuery.d.ts","sourceRoot":"","sources":["../../src/createPathQuery.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,oIAAoI;IACpI,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0HAA0H;IAC1H,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAKD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8HAA8H;IAC9H,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,GAAG,MAAM,CASlF"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createPathQuery = createPathQuery;
|
|
6
|
+
const createMultiCollection_js_1 = require("./createMultiCollection.js");
|
|
7
|
+
function isCircularPath(path) {
|
|
8
|
+
return "center" in path;
|
|
9
|
+
}
|
|
10
|
+
const optionKeyMap = {
|
|
11
|
+
lineColor: "lc",
|
|
12
|
+
lineOpacity: "la",
|
|
13
|
+
fillColor: "fc",
|
|
14
|
+
fillOpacity: "fa",
|
|
15
|
+
lineWidthInPixels: "lw",
|
|
16
|
+
radius: "ra",
|
|
17
|
+
};
|
|
18
|
+
function isOptionKey(key) {
|
|
19
|
+
return key in optionKeyMap;
|
|
20
|
+
}
|
|
21
|
+
function comosePathVal(coordinates, options) {
|
|
22
|
+
// compose the coordinates query string
|
|
23
|
+
const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join("|");
|
|
24
|
+
// compose the options query string
|
|
25
|
+
const optionsQueryStr = Object.entries(options).reduce((queryStr, [key, val]) => {
|
|
26
|
+
if (!isOptionKey(key))
|
|
27
|
+
throw Error(`Unknown key ${key}`);
|
|
28
|
+
queryStr += `${queryStr ? "|" : ""}${optionKeyMap[key]}${val}`;
|
|
29
|
+
return queryStr;
|
|
30
|
+
}, "");
|
|
31
|
+
return optionsQueryStr + "||" + coordinatesQueryStr;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create a path query string for _get map static image_ request.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts snippet:ReadmeSampleCreatePathQuery
|
|
38
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
39
|
+
* import MapsRender, { CircularPath, PolygonalPath, createPathQuery } from "@azure-rest/maps-render";
|
|
40
|
+
* import { createWriteStream } from "node:fs";
|
|
41
|
+
*
|
|
42
|
+
* const credential = new DefaultAzureCredential();
|
|
43
|
+
* const client = MapsRender(credential, "<maps-account-client-id>");
|
|
44
|
+
*
|
|
45
|
+
* const circularPath: CircularPath = {
|
|
46
|
+
* center: [52.4559, 13.228],
|
|
47
|
+
* radiusInMeters: 10000,
|
|
48
|
+
* options: {
|
|
49
|
+
* lineColor: "000000",
|
|
50
|
+
* lineOpacity: 0.9,
|
|
51
|
+
* lineWidthInPixels: 2,
|
|
52
|
+
* },
|
|
53
|
+
* };
|
|
54
|
+
*
|
|
55
|
+
* const linearPath: PolygonalPath = {
|
|
56
|
+
* coordinates: [
|
|
57
|
+
* [52.577, 13.35],
|
|
58
|
+
* [52.6, 13.2988],
|
|
59
|
+
* [52.32, 13.2988],
|
|
60
|
+
* ],
|
|
61
|
+
* options: {
|
|
62
|
+
* lineColor: "000000",
|
|
63
|
+
* lineOpacity: 0.9,
|
|
64
|
+
* lineWidthInPixels: 2,
|
|
65
|
+
* },
|
|
66
|
+
* };
|
|
67
|
+
*
|
|
68
|
+
* const polygonPath: PolygonalPath = {
|
|
69
|
+
* coordinates: [
|
|
70
|
+
* [52.577, 13.35],
|
|
71
|
+
* [52.6, 13.2988],
|
|
72
|
+
* [52.32, 13.2988],
|
|
73
|
+
* [52.577, 13.35],
|
|
74
|
+
* ],
|
|
75
|
+
* options: {
|
|
76
|
+
* lineColor: "000000",
|
|
77
|
+
* lineOpacity: 0.9,
|
|
78
|
+
* lineWidthInPixels: 2,
|
|
79
|
+
* fillColor: "FFFFFF",
|
|
80
|
+
* fillOpacity: 0.8,
|
|
81
|
+
* },
|
|
82
|
+
* };
|
|
83
|
+
*
|
|
84
|
+
* const path = createPathQuery([circularPath, linearPath, polygonPath]);
|
|
85
|
+
* // Send the request
|
|
86
|
+
* const response = await client
|
|
87
|
+
* .path("/map/static")
|
|
88
|
+
* .get({
|
|
89
|
+
* queryParameters: {
|
|
90
|
+
* bbox: [13.228, 52.4559, 13.5794, 52.629],
|
|
91
|
+
* path,
|
|
92
|
+
* },
|
|
93
|
+
* })
|
|
94
|
+
* .asNodeStream();
|
|
95
|
+
*
|
|
96
|
+
* // Handle the error.
|
|
97
|
+
* if (!response.body) {
|
|
98
|
+
* throw Error("No response body");
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* response.body.pipe(createWriteStream("path.png"));
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.
|
|
105
|
+
* @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.
|
|
106
|
+
*/
|
|
107
|
+
function createPathQuery(paths) {
|
|
108
|
+
const pathQueries = paths.map((path) => {
|
|
109
|
+
if (isCircularPath(path)) {
|
|
110
|
+
const { center, radiusInMeters, options } = path;
|
|
111
|
+
return comosePathVal([center], Object.assign(Object.assign({}, options), { radius: radiusInMeters }));
|
|
112
|
+
}
|
|
113
|
+
return comosePathVal(path.coordinates, path.options || {});
|
|
114
|
+
});
|
|
115
|
+
return (0, createMultiCollection_js_1.createMultiCollection)("path", pathQueries);
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=createPathQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPathQuery.js","sourceRoot":"","sources":["../../src/createPathQuery.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA2JlC,0CASC;AAjKD,yEAAmE;AAwCnE,SAAS,cAAc,CAAC,IAAkC;IACxD,OAAO,QAAQ,IAAI,IAAI,CAAC;AAC1B,CAAC;AAWD,MAAM,YAAY,GAAgD;IAChE,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,IAAI;IACvB,MAAM,EAAE,IAAI;CACb,CAAC;AAEF,SAAS,WAAW,CAAC,GAAQ;IAC3B,OAAO,GAAG,IAAI,YAAY,CAAC;AAC7B,CAAC;AAED,SAAS,aAAa,CAAC,WAAqB,EAAE,OAA8B;IAC1E,uCAAuC;IACvC,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvF,mCAAmC;IACnC,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE;QACtF,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;YAAE,MAAM,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC,CAAC;QACzD,QAAQ,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC;QAC/D,OAAO,QAAQ,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,eAAe,GAAG,IAAI,GAAG,mBAAmB,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,SAAgB,eAAe,CAAC,KAA0C;IACxE,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACrC,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;YACjD,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,kCAAO,OAAO,KAAE,MAAM,EAAE,cAAc,IAAG,CAAC;QACzE,CAAC;QACD,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IACH,OAAO,IAAA,gDAAqB,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection.js\";\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 snippet:ReadmeSampleCreatePathQuery\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import MapsRender, { CircularPath, PolygonalPath, createPathQuery } from \"@azure-rest/maps-render\";\n * import { createWriteStream } from \"node:fs\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRender(credential, \"<maps-account-client-id>\");\n *\n * const circularPath: 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: PolygonalPath = {\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: PolygonalPath = {\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\n * .path(\"/map/static\")\n * .get({\n * queryParameters: {\n * bbox: [13.228, 52.4559, 13.5794, 52.629],\n * path,\n * },\n * })\n * .asNodeStream();\n *\n * // Handle the error.\n * if (!response.body) {\n * throw Error(\"No response body\");\n * }\n *\n * response.body.pipe(createWriteStream(\"path.png\"));\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,102 @@
|
|
|
1
|
+
import type { LatLon } from "@azure/maps-common";
|
|
2
|
+
/**
|
|
3
|
+
* Specify how the pin's position and label text.
|
|
4
|
+
*/
|
|
5
|
+
export interface Pin {
|
|
6
|
+
/** The coordinate of the pin. */
|
|
7
|
+
coordinate: LatLon;
|
|
8
|
+
/** The label text for the pin. */
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The pin options for default/none image style..
|
|
13
|
+
*/
|
|
14
|
+
export interface PinOptions {
|
|
15
|
+
/** The opacity of the pin. Range from 0 to 1 */
|
|
16
|
+
opacity?: number;
|
|
17
|
+
/**
|
|
18
|
+
* 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).
|
|
19
|
+
* To override the label anchor, using the _labelAnchor_ option and provide X and Y pixel coordinates for the anchor.
|
|
20
|
+
* 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.
|
|
21
|
+
* 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]\}
|
|
22
|
+
* */
|
|
23
|
+
labelAnchor?: [number, number];
|
|
24
|
+
/** Color of the label. Range from 000000 to FFFFFF */
|
|
25
|
+
labelColor?: string;
|
|
26
|
+
/** Size of the label in pixels. */
|
|
27
|
+
labelSizeInPixels?: number;
|
|
28
|
+
/**
|
|
29
|
+
* 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.
|
|
30
|
+
* To override the anchor location of the pin image, use the _pinAnchor_ option. This uses the same format as the _labelAnchor_ options.
|
|
31
|
+
* 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]\}
|
|
32
|
+
*/
|
|
33
|
+
pinAnchor?: [number, number];
|
|
34
|
+
/** The ration of the pin. Range from -360 to 360*/
|
|
35
|
+
rotationInDegree?: number;
|
|
36
|
+
/** The scale of the pin. Should be greater than 0. */
|
|
37
|
+
scale?: number;
|
|
38
|
+
/** Color of the pin. Range from 000000 to FFFFFF */
|
|
39
|
+
pinColor?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface PinSet {
|
|
42
|
+
pins: Pin[];
|
|
43
|
+
pinImage?: "default" | "none" | string;
|
|
44
|
+
options?: PinOptions;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create a pin query string for _get map static image_
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts snippet:ReadmeSampleCreatePinsQuery
|
|
51
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
52
|
+
* import MapsRender, { PinSet, createPinsQuery } from "@azure-rest/maps-render";
|
|
53
|
+
* import { createWriteStream } from "node:fs";
|
|
54
|
+
*
|
|
55
|
+
* const credential = new DefaultAzureCredential();
|
|
56
|
+
* const client = MapsRender(credential, "<maps-account-client-id>");
|
|
57
|
+
*
|
|
58
|
+
* const pins: PinSet[] = [
|
|
59
|
+
* {
|
|
60
|
+
* pins: [
|
|
61
|
+
* { coordinate: [52.577, 13.35], label: "Label start" },
|
|
62
|
+
* { coordinate: [52.6, 13.2988], label: "Label end" },
|
|
63
|
+
* ],
|
|
64
|
+
* pinImage: "default",
|
|
65
|
+
* options: {
|
|
66
|
+
* scale: 0.9,
|
|
67
|
+
* pinColor: "FF0000",
|
|
68
|
+
* labelColor: "0000FF",
|
|
69
|
+
* labelSizeInPixels: 18,
|
|
70
|
+
* },
|
|
71
|
+
* },
|
|
72
|
+
* ];
|
|
73
|
+
*
|
|
74
|
+
* const path = createPinsQuery(pins);
|
|
75
|
+
*
|
|
76
|
+
* const response = await client
|
|
77
|
+
* .path("/map/static")
|
|
78
|
+
* .get({
|
|
79
|
+
* queryParameters: {
|
|
80
|
+
* bbox: [13.228, 52.4559, 13.5794, 52.62],
|
|
81
|
+
* zoom: 10,
|
|
82
|
+
* path,
|
|
83
|
+
* },
|
|
84
|
+
* skipUrlEncoding: true,
|
|
85
|
+
* })
|
|
86
|
+
* .asNodeStream();
|
|
87
|
+
*
|
|
88
|
+
* // Handle the error.
|
|
89
|
+
* if (!response.body) {
|
|
90
|
+
* throw Error("No response body");
|
|
91
|
+
* }
|
|
92
|
+
*
|
|
93
|
+
* response.body.pipe(createWriteStream("pin.png"));
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @param pins - An array of {@link Pin} that specify the positions and label text of each pin.
|
|
97
|
+
* @param pinImage - Specify the image source for custom pin. Set this to "none" if you don't want to show a pin image.
|
|
98
|
+
* @param options - The style options of the pins. See {@link PinOptions}
|
|
99
|
+
* @returns - The composed query string.
|
|
100
|
+
*/
|
|
101
|
+
export declare function createPinsQuery(pinSets: PinSet[]): string;
|
|
102
|
+
//# sourceMappingURL=createPinsQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPinsQuery.d.ts","sourceRoot":"","sources":["../../src/createPinsQuery.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;SAKK;IACL,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAiBD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACvC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAkBzD"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createPinsQuery = createPinsQuery;
|
|
6
|
+
const createMultiCollection_js_1 = require("./createMultiCollection.js");
|
|
7
|
+
const optionKeyMap = {
|
|
8
|
+
opacity: "al",
|
|
9
|
+
labelAnchor: "la",
|
|
10
|
+
labelColor: "lc",
|
|
11
|
+
labelSizeInPixels: "ls",
|
|
12
|
+
pinAnchor: "an",
|
|
13
|
+
rotationInDegree: "ro",
|
|
14
|
+
scale: "sc",
|
|
15
|
+
pinColor: "co",
|
|
16
|
+
};
|
|
17
|
+
function isOptionKeyMap(key) {
|
|
18
|
+
return key in optionKeyMap;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a pin query string for _get map static image_
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts snippet:ReadmeSampleCreatePinsQuery
|
|
25
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
26
|
+
* import MapsRender, { PinSet, createPinsQuery } from "@azure-rest/maps-render";
|
|
27
|
+
* import { createWriteStream } from "node:fs";
|
|
28
|
+
*
|
|
29
|
+
* const credential = new DefaultAzureCredential();
|
|
30
|
+
* const client = MapsRender(credential, "<maps-account-client-id>");
|
|
31
|
+
*
|
|
32
|
+
* const pins: PinSet[] = [
|
|
33
|
+
* {
|
|
34
|
+
* pins: [
|
|
35
|
+
* { coordinate: [52.577, 13.35], label: "Label start" },
|
|
36
|
+
* { coordinate: [52.6, 13.2988], label: "Label end" },
|
|
37
|
+
* ],
|
|
38
|
+
* pinImage: "default",
|
|
39
|
+
* options: {
|
|
40
|
+
* scale: 0.9,
|
|
41
|
+
* pinColor: "FF0000",
|
|
42
|
+
* labelColor: "0000FF",
|
|
43
|
+
* labelSizeInPixels: 18,
|
|
44
|
+
* },
|
|
45
|
+
* },
|
|
46
|
+
* ];
|
|
47
|
+
*
|
|
48
|
+
* const path = createPinsQuery(pins);
|
|
49
|
+
*
|
|
50
|
+
* const response = await client
|
|
51
|
+
* .path("/map/static")
|
|
52
|
+
* .get({
|
|
53
|
+
* queryParameters: {
|
|
54
|
+
* bbox: [13.228, 52.4559, 13.5794, 52.62],
|
|
55
|
+
* zoom: 10,
|
|
56
|
+
* path,
|
|
57
|
+
* },
|
|
58
|
+
* skipUrlEncoding: true,
|
|
59
|
+
* })
|
|
60
|
+
* .asNodeStream();
|
|
61
|
+
*
|
|
62
|
+
* // Handle the error.
|
|
63
|
+
* if (!response.body) {
|
|
64
|
+
* throw Error("No response body");
|
|
65
|
+
* }
|
|
66
|
+
*
|
|
67
|
+
* response.body.pipe(createWriteStream("pin.png"));
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @param pins - An array of {@link Pin} that specify the positions and label text of each pin.
|
|
71
|
+
* @param pinImage - Specify the image source for custom pin. Set this to "none" if you don't want to show a pin image.
|
|
72
|
+
* @param options - The style options of the pins. See {@link PinOptions}
|
|
73
|
+
* @returns - The composed query string.
|
|
74
|
+
*/
|
|
75
|
+
function createPinsQuery(pinSets) {
|
|
76
|
+
const pinsQueries = pinSets.map(({ pins, pinImage = "default", options = {} }) => {
|
|
77
|
+
// compose the pins' position query string
|
|
78
|
+
const pinsQueryStr = pins
|
|
79
|
+
.map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : ""}${lon} ${lat}`)
|
|
80
|
+
.join("|");
|
|
81
|
+
// compose the options query string
|
|
82
|
+
const optionsQueryStr = Object.entries(options).reduce((queryStr, [key, val]) => {
|
|
83
|
+
if (!isOptionKeyMap(key))
|
|
84
|
+
throw Error(`Unexpected option: ${key}`);
|
|
85
|
+
if (Array.isArray(val))
|
|
86
|
+
return (queryStr += `|${optionKeyMap[key]}${val[0]} ${val[1]}`);
|
|
87
|
+
return (queryStr += `|${optionKeyMap[key]}${val}`);
|
|
88
|
+
}, "");
|
|
89
|
+
if (pinImage === "none" || pinImage === "default") {
|
|
90
|
+
return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;
|
|
91
|
+
}
|
|
92
|
+
return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;
|
|
93
|
+
});
|
|
94
|
+
return (0, createMultiCollection_js_1.createMultiCollection)("pins", pinsQueries);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=createPinsQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPinsQuery.js","sourceRoot":"","sources":["../../src/createPinsQuery.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA0HlC,0CAkBC;AAzID,yEAAmE;AA2CnE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,SAAgB,eAAe,CAAC,OAAiB;IAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,EAAE;QAC/E,0CAA0C;QAC1C,MAAM,YAAY,GAAG,IAAI;aACtB,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;aACvF,IAAI,CAAC,GAAG,CAAC,CAAC;QACb,mCAAmC;QACnC,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE;YACtF,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;gBAAE,MAAM,KAAK,CAAC,sBAAsB,GAAG,EAAE,CAAC,CAAC;YACnE,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;gBAAE,OAAO,CAAC,QAAQ,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACxF,OAAO,CAAC,QAAQ,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAClD,OAAO,GAAG,QAAQ,GAAG,eAAe,KAAK,YAAY,EAAE,CAAC;QAC1D,CAAC;QACD,OAAO,SAAS,eAAe,KAAK,YAAY,KAAK,QAAQ,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,OAAO,IAAA,gDAAqB,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { LatLon } from \"@azure/maps-common\";\nimport { createMultiCollection } from \"./createMultiCollection.js\";\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 snippet:ReadmeSampleCreatePinsQuery\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import MapsRender, { PinSet, createPinsQuery } from \"@azure-rest/maps-render\";\n * import { createWriteStream } from \"node:fs\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsRender(credential, \"<maps-account-client-id>\");\n *\n * const pins: PinSet[] = [\n * {\n * pins: [\n * { coordinate: [52.577, 13.35], label: \"Label start\" },\n * { coordinate: [52.6, 13.2988], label: \"Label end\" },\n * ],\n * pinImage: \"default\",\n * options: {\n * scale: 0.9,\n * pinColor: \"FF0000\",\n * labelColor: \"0000FF\",\n * labelSizeInPixels: 18,\n * },\n * },\n * ];\n *\n * const path = createPinsQuery(pins);\n *\n * const response = await client\n * .path(\"/map/static\")\n * .get({\n * queryParameters: {\n * bbox: [13.228, 52.4559, 13.5794, 52.62],\n * zoom: 10,\n * path,\n * },\n * skipUrlEncoding: true,\n * })\n * .asNodeStream();\n *\n * // Handle the error.\n * if (!response.body) {\n * throw Error(\"No response body\");\n * }\n *\n * response.body.pipe(createWriteStream(\"pin.png\"));\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,131 @@
|
|
|
1
|
+
import { RenderGetMapTileParameters, RenderGetMapTilesetParameters, RenderGetMapAttributionParameters, RenderGetMapStateTileParameters, RenderGetCopyrightCaptionParameters, RenderGetMapStaticImageParameters, RenderGetCopyrightFromBoundingBoxParameters, RenderGetCopyrightForTileParameters, RenderGetCopyrightForWorldParameters } from "./parameters.js";
|
|
2
|
+
import { RenderGetMapTile200Response, RenderGetMapTileDefaultResponse, RenderGetMapTileset200Response, RenderGetMapTilesetDefaultResponse, RenderGetMapAttribution200Response, RenderGetMapAttributionDefaultResponse, RenderGetMapStateTile200Response, RenderGetMapStateTileDefaultResponse, RenderGetCopyrightCaption200Response, RenderGetCopyrightCaptionDefaultResponse, RenderGetMapStaticImage200Response, RenderGetMapStaticImageDefaultResponse, RenderGetCopyrightFromBoundingBox200Response, RenderGetCopyrightFromBoundingBoxDefaultResponse, RenderGetCopyrightForTile200Response, RenderGetCopyrightForTileDefaultResponse, RenderGetCopyrightForWorld200Response, RenderGetCopyrightForWorldDefaultResponse } from "./responses.js";
|
|
3
|
+
import { Client, StreamableMethod } from "@azure-rest/core-client";
|
|
4
|
+
export interface GetMapTile {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* The `Get Map Tiles` API in an HTTP GET request that allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control ([Web SDK](/azure/azure-maps/about-azure-maps#web-sdk)) and [Android SDK](/azure/azure-maps/about-azure-maps#android-sdk).
|
|
8
|
+
*/
|
|
9
|
+
get(options: RenderGetMapTileParameters): StreamableMethod<RenderGetMapTile200Response | RenderGetMapTileDefaultResponse>;
|
|
10
|
+
}
|
|
11
|
+
export interface GetMapTileset {
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* The Get Map Tileset API allows users to request metadata for a tileset.
|
|
15
|
+
*/
|
|
16
|
+
get(options: RenderGetMapTilesetParameters): StreamableMethod<RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse>;
|
|
17
|
+
}
|
|
18
|
+
export interface GetMapAttribution {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* The `Get Map Attribution` API allows users to request map copyright attribution information for a section of a tileset.
|
|
22
|
+
*/
|
|
23
|
+
get(options: RenderGetMapAttributionParameters): StreamableMethod<RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse>;
|
|
24
|
+
}
|
|
25
|
+
export interface GetMapStateTile {
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling. For more information, see [Zoom Levels and Tile Grid](/azure/location-based-services/zoom-levels-and-tile-grid).
|
|
29
|
+
*/
|
|
30
|
+
get(options: RenderGetMapStateTileParameters): StreamableMethod<RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse>;
|
|
31
|
+
}
|
|
32
|
+
export interface GetCopyrightCaption {
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* The `Get Copyright Caption` API is an HTTP GET request designed to serve copyright information to be used with tiles requested from the Render service. In addition to a basic copyright for the whole map, it can serve specific groups of copyrights for some countries/regions.
|
|
36
|
+
*
|
|
37
|
+
* As an alternative to copyrights for map request, it can also return captions for displaying provider information on the map.
|
|
38
|
+
*/
|
|
39
|
+
get(options?: RenderGetCopyrightCaptionParameters): StreamableMethod<RenderGetCopyrightCaption200Response | RenderGetCopyrightCaptionDefaultResponse>;
|
|
40
|
+
}
|
|
41
|
+
export interface GetMapStaticImage {
|
|
42
|
+
/**
|
|
43
|
+
* This rendering API produces static, rasterized map views of a user-defined area. It's suitable for lightweight web applications, when the desired user experience doesn't require interactive map controls, or when bandwidth is limited. This API is also useful for embedding maps in applications outside of the browser, in backend services, report generation, or desktop applications.
|
|
44
|
+
*
|
|
45
|
+
* This API includes parameters for basic data visualization:
|
|
46
|
+
*
|
|
47
|
+
* - Labeled pushpins in multiple styles.
|
|
48
|
+
* - Render circle, path, and polygon geometry types.
|
|
49
|
+
*
|
|
50
|
+
* For more information and detailed examples, see [Render custom data on a raster map](/azure/azure-maps/how-to-render-custom-data).
|
|
51
|
+
* <br><br>
|
|
52
|
+
* The dimensions of the bbox parameter are constrained, depending on the zoom level. This ensures the resulting image has an appropriate level of detail.
|
|
53
|
+
* <br><br>
|
|
54
|
+
*
|
|
55
|
+
* |Zoom Level | Min Lon Range | Max Lon Range | Min Lat Range| Max Lat Range|
|
|
56
|
+
* |:----------|:----------------|:----------------|:----------------|:-------------|
|
|
57
|
+
* |0 | 56.25 | 360.0 | 30.1105585173 | 180.0 |
|
|
58
|
+
* |1 | 28.125 | 360.0 | 14.87468995 | 180.0 |
|
|
59
|
+
* |2 | 14.063 | 351.5625 | 7.4130741851 | 137.9576312246 |
|
|
60
|
+
* |3 | 7.03125 | 175.78125 | 3.7034501005 | 73.6354071932 |
|
|
61
|
+
* |4 | 3.515625 | 87.890625 | 1.8513375155 | 35.4776115315 |
|
|
62
|
+
* |5 | 1.7578125 | 43.9453125 | 0.925620264 | 17.4589959239 |
|
|
63
|
+
* |6 | 0.87890625 | 21.97265625 | 0.4628040687 | 8.6907788223 |
|
|
64
|
+
* |7 | 0.439453125 | 10.986328125 | 0.2314012764 | 4.3404320789 |
|
|
65
|
+
* |8 | 0.2197265625 | 5.4931640625 | 0.1157005434 | 2.1695927024 |
|
|
66
|
+
* |9 | 0.1098632812 | 2.7465820312 | 0.0578502599 | 1.0847183194 |
|
|
67
|
+
* |10 | 0.0549316406 | 1.3732910156 | 0.0289251285 | 0.5423494021 |
|
|
68
|
+
* |11 | 0.0274658203 | 0.6866455078 | 0.014462564 | 0.2711734813 |
|
|
69
|
+
* |12 | 0.0137329102 | 0.3433227539 | 0.007231282 | 0.1355865882 |
|
|
70
|
+
* |13 | 0.0068664551 | 0.171661377 | 0.003615641 | 0.067793275 |
|
|
71
|
+
* |14 | 0.0034332275 | 0.0858306885 | 0.0018078205 | 0.0338966351 |
|
|
72
|
+
* |15 | 0.0017166138 | 0.0429153442 | 0.0009039102 | 0.0169483173 |
|
|
73
|
+
* |16 | 0.0008583069 | 0.0214576721 | 0.0004519551 | 0.0084741586 |
|
|
74
|
+
* |17 | 0.0004291534 | 0.0107288361 | 0.0002259776 | 0.0042370793 |
|
|
75
|
+
* |18 | 0.0002145767 | 0.005364418 | 0.0001129888 | 0.0021185396 |
|
|
76
|
+
* |19 | 0.0001072884 | 0.002682209 | 5.64944E-05 | 0.0010592698 |
|
|
77
|
+
* |20 | 5.36442E-05 | 0.0013411045 | 2.82472E-05 | 0.0005296349 |
|
|
78
|
+
*
|
|
79
|
+
* _Note_ : Either **center** or **bbox** parameter must be supplied to the API.
|
|
80
|
+
*/
|
|
81
|
+
get(options?: RenderGetMapStaticImageParameters): StreamableMethod<RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse>;
|
|
82
|
+
}
|
|
83
|
+
export interface GetCopyrightFromBoundingBox {
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates
|
|
87
|
+
*/
|
|
88
|
+
get(options: RenderGetCopyrightFromBoundingBoxParameters): StreamableMethod<RenderGetCopyrightFromBoundingBox200Response | RenderGetCopyrightFromBoundingBoxDefaultResponse>;
|
|
89
|
+
}
|
|
90
|
+
export interface GetCopyrightForTile {
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates. For more information, see [Zoom Levels and Tile Grid](/azure/azure-maps/zoom-levels-and-tile-grid).
|
|
94
|
+
*
|
|
95
|
+
* Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.
|
|
96
|
+
*/
|
|
97
|
+
get(options: RenderGetCopyrightForTileParameters): StreamableMethod<RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse>;
|
|
98
|
+
}
|
|
99
|
+
export interface GetCopyrightForWorld {
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* Returns the copyright information for the world. To obtain the default copyright information for the whole world, don't specify a tile or bounding box.
|
|
103
|
+
*
|
|
104
|
+
* Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.
|
|
105
|
+
*/
|
|
106
|
+
get(options?: RenderGetCopyrightForWorldParameters): StreamableMethod<RenderGetCopyrightForWorld200Response | RenderGetCopyrightForWorldDefaultResponse>;
|
|
107
|
+
}
|
|
108
|
+
export interface Routes {
|
|
109
|
+
/** Resource for '/map/tile' has methods for the following verbs: get */
|
|
110
|
+
(path: "/map/tile"): GetMapTile;
|
|
111
|
+
/** Resource for '/map/tileset' has methods for the following verbs: get */
|
|
112
|
+
(path: "/map/tileset"): GetMapTileset;
|
|
113
|
+
/** Resource for '/map/attribution' has methods for the following verbs: get */
|
|
114
|
+
(path: "/map/attribution"): GetMapAttribution;
|
|
115
|
+
/** Resource for '/map/statetile' has methods for the following verbs: get */
|
|
116
|
+
(path: "/map/statetile"): GetMapStateTile;
|
|
117
|
+
/** Resource for '/map/copyright/caption/\{format\}' has methods for the following verbs: get */
|
|
118
|
+
(path: "/map/copyright/caption/{format}", format: "json" | "xml"): GetCopyrightCaption;
|
|
119
|
+
/** Resource for '/map/static' has methods for the following verbs: get */
|
|
120
|
+
(path: "/map/static"): GetMapStaticImage;
|
|
121
|
+
/** Resource for '/map/copyright/bounding/\{format\}' has methods for the following verbs: get */
|
|
122
|
+
(path: "/map/copyright/bounding/{format}", format: "json" | "xml"): GetCopyrightFromBoundingBox;
|
|
123
|
+
/** Resource for '/map/copyright/tile/\{format\}' has methods for the following verbs: get */
|
|
124
|
+
(path: "/map/copyright/tile/{format}", format: "json" | "xml"): GetCopyrightForTile;
|
|
125
|
+
/** Resource for '/map/copyright/world/\{format\}' has methods for the following verbs: get */
|
|
126
|
+
(path: "/map/copyright/world/{format}", format: "json" | "xml"): GetCopyrightForWorld;
|
|
127
|
+
}
|
|
128
|
+
export type MapsRenderClient = Client & {
|
|
129
|
+
path: Routes;
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=clientDefinitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../../src/generated/clientDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,iCAAiC,EACjC,+BAA+B,EAC/B,mCAAmC,EACnC,iCAAiC,EACjC,2CAA2C,EAC3C,mCAAmC,EACnC,oCAAoC,EACrC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,EAC9B,kCAAkC,EAClC,kCAAkC,EAClC,sCAAsC,EACtC,gCAAgC,EAChC,oCAAoC,EACpC,oCAAoC,EACpC,wCAAwC,EACxC,kCAAkC,EAClC,sCAAsC,EACtC,4CAA4C,EAC5C,gDAAgD,EAChD,oCAAoC,EACpC,wCAAwC,EACxC,qCAAqC,EACrC,yCAAyC,EAC1C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,GAAG,CACD,OAAO,EAAE,0BAA0B,GAClC,gBAAgB,CACjB,2BAA2B,GAAG,+BAA+B,CAC9D,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,GAAG,CACD,OAAO,EAAE,6BAA6B,GACrC,gBAAgB,CACjB,8BAA8B,GAAG,kCAAkC,CACpE,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,GAAG,CACD,OAAO,EAAE,iCAAiC,GACzC,gBAAgB,CACjB,kCAAkC,GAAG,sCAAsC,CAC5E,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,GAAG,CACD,OAAO,EAAE,+BAA+B,GACvC,gBAAgB,CACjB,gCAAgC,GAAG,oCAAoC,CACxE,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,mCAAmC,GAC5C,gBAAgB,CACf,oCAAoC,GACpC,wCAAwC,CAC3C,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,iCAAiC,GAC1C,gBAAgB,CACjB,kCAAkC,GAAG,sCAAsC,CAC5E,CAAC;CACH;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,GAAG,CACD,OAAO,EAAE,2CAA2C,GACnD,gBAAgB,CACf,4CAA4C,GAC5C,gDAAgD,CACnD,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,GAAG,CACD,OAAO,EAAE,mCAAmC,GAC3C,gBAAgB,CACf,oCAAoC,GACpC,wCAAwC,CAC3C,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,oCAAoC,GAC7C,gBAAgB,CACf,qCAAqC,GACrC,yCAAyC,CAC5C,CAAC;CACH;AAED,MAAM,WAAW,MAAM;IACrB,wEAAwE;IACxE,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC;IAChC,2EAA2E;IAC3E,CAAC,IAAI,EAAE,cAAc,GAAG,aAAa,CAAC;IACtC,+EAA+E;IAC/E,CAAC,IAAI,EAAE,kBAAkB,GAAG,iBAAiB,CAAC;IAC9C,6EAA6E;IAC7E,CAAC,IAAI,EAAE,gBAAgB,GAAG,eAAe,CAAC;IAC1C,gGAAgG;IAChG,CACE,IAAI,EAAE,iCAAiC,EACvC,MAAM,EAAE,MAAM,GAAG,KAAK,GACrB,mBAAmB,CAAC;IACvB,0EAA0E;IAC1E,CAAC,IAAI,EAAE,aAAa,GAAG,iBAAiB,CAAC;IACzC,iGAAiG;IACjG,CACE,IAAI,EAAE,kCAAkC,EACxC,MAAM,EAAE,MAAM,GAAG,KAAK,GACrB,2BAA2B,CAAC;IAC/B,6FAA6F;IAC7F,CACE,IAAI,EAAE,8BAA8B,EACpC,MAAM,EAAE,MAAM,GAAG,KAAK,GACrB,mBAAmB,CAAC;IACvB,8FAA8F;IAC9F,CACE,IAAI,EAAE,+BAA+B,EACrC,MAAM,EAAE,MAAM,GAAG,KAAK,GACrB,oBAAoB,CAAC;CACzB;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -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.js\";\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.js\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetMapTile {\n /**\n *\n * The `Get Map Tiles` API in an HTTP GET request that allows users to request map tiles in vector or raster formats typically to be integrated into a map control or SDK. Some example tiles that can be requested are Azure Maps road tiles, real-time Weather Radar tiles or the map tiles created using [Azure Maps Creator](https://aka.ms/amcreator). By default, Azure Maps uses vector tiles for its web map control ([Web SDK](/azure/azure-maps/about-azure-maps#web-sdk)) and [Android SDK](/azure/azure-maps/about-azure-maps#android-sdk).\n */\n get(\n options: RenderGetMapTileParameters,\n ): StreamableMethod<\n RenderGetMapTile200Response | RenderGetMapTileDefaultResponse\n >;\n}\n\nexport interface GetMapTileset {\n /**\n *\n * The Get Map Tileset API allows users to request metadata for a tileset.\n */\n get(\n options: RenderGetMapTilesetParameters,\n ): StreamableMethod<\n RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse\n >;\n}\n\nexport interface GetMapAttribution {\n /**\n *\n * The `Get Map Attribution` API allows users to request map copyright attribution information for a section of a tileset.\n */\n get(\n options: RenderGetMapAttributionParameters,\n ): StreamableMethod<\n RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse\n >;\n}\n\nexport interface GetMapStateTile {\n /**\n *\n * Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling. For more information, see [Zoom Levels and Tile Grid](/azure/location-based-services/zoom-levels-and-tile-grid).\n */\n get(\n options: RenderGetMapStateTileParameters,\n ): StreamableMethod<\n RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse\n >;\n}\n\nexport interface GetCopyrightCaption {\n /**\n *\n * The `Get Copyright Caption` API is an HTTP GET request designed to serve copyright information to be used with tiles requested from the Render service. In addition to a basic copyright for the whole map, it can serve specific groups of copyrights for some countries/regions.\n *\n * As an alternative to copyrights for map request, it can also return captions for displaying provider information on the map.\n */\n get(\n options?: RenderGetCopyrightCaptionParameters,\n ): StreamableMethod<\n | RenderGetCopyrightCaption200Response\n | RenderGetCopyrightCaptionDefaultResponse\n >;\n}\n\nexport interface GetMapStaticImage {\n /**\n * This rendering API produces static, rasterized map views of a user-defined area. It's suitable for lightweight web applications, when the desired user experience doesn't require interactive map controls, or when bandwidth is limited. This API is also useful for embedding maps in applications outside of the browser, in backend services, report generation, or desktop applications.\n *\n * This API includes parameters for basic data visualization:\n *\n * - Labeled pushpins in multiple styles.\n * - Render circle, path, and polygon geometry types.\n *\n * For more information and detailed examples, see [Render custom data on a raster map](/azure/azure-maps/how-to-render-custom-data).\n * <br><br>\n * The dimensions of the bbox parameter are constrained, depending on the zoom level. This ensures the resulting image has an appropriate level of detail.\n * <br><br>\n *\n * |Zoom Level | Min Lon Range | Max Lon Range | Min Lat Range| Max Lat Range|\n * |:----------|:----------------|:----------------|:----------------|:-------------|\n * |0 | 56.25 | 360.0 | 30.1105585173 | 180.0 |\n * |1 | 28.125 | 360.0 | 14.87468995 | 180.0 |\n * |2 | 14.063 | 351.5625 | 7.4130741851 | 137.9576312246 |\n * |3 | 7.03125 | 175.78125 | 3.7034501005 | 73.6354071932 |\n * |4 | 3.515625 | 87.890625 | 1.8513375155 | 35.4776115315 |\n * |5 | 1.7578125 | 43.9453125 | 0.925620264 | 17.4589959239 |\n * |6 | 0.87890625 | 21.97265625 | 0.4628040687 | 8.6907788223 |\n * |7 | 0.439453125 | 10.986328125 | 0.2314012764 | 4.3404320789 |\n * |8 | 0.2197265625 | 5.4931640625 | 0.1157005434 | 2.1695927024 |\n * |9 | 0.1098632812 | 2.7465820312 | 0.0578502599 | 1.0847183194 |\n * |10 | 0.0549316406 | 1.3732910156 | 0.0289251285 | 0.5423494021 |\n * |11 | 0.0274658203 | 0.6866455078 | 0.014462564 | 0.2711734813 |\n * |12 | 0.0137329102 | 0.3433227539 | 0.007231282 | 0.1355865882 |\n * |13 | 0.0068664551 | 0.171661377 | 0.003615641 | 0.067793275 |\n * |14 | 0.0034332275 | 0.0858306885 | 0.0018078205 | 0.0338966351 |\n * |15 | 0.0017166138 | 0.0429153442 | 0.0009039102 | 0.0169483173 |\n * |16 | 0.0008583069 | 0.0214576721 | 0.0004519551 | 0.0084741586 |\n * |17 | 0.0004291534 | 0.0107288361 | 0.0002259776 | 0.0042370793 |\n * |18 | 0.0002145767 | 0.005364418 | 0.0001129888 | 0.0021185396 |\n * |19 | 0.0001072884 | 0.002682209 | 5.64944E-05 | 0.0010592698 |\n * |20 | 5.36442E-05 | 0.0013411045 | 2.82472E-05 | 0.0005296349 |\n *\n * _Note_ : Either **center** or **bbox** parameter must be supplied to the API.\n */\n get(\n options?: RenderGetMapStaticImageParameters,\n ): StreamableMethod<\n RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse\n >;\n}\n\nexport interface GetCopyrightFromBoundingBox {\n /**\n *\n * Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates\n */\n get(\n options: RenderGetCopyrightFromBoundingBoxParameters,\n ): StreamableMethod<\n | RenderGetCopyrightFromBoundingBox200Response\n | RenderGetCopyrightFromBoundingBoxDefaultResponse\n >;\n}\n\nexport interface GetCopyrightForTile {\n /**\n *\n * To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates. For more information, see [Zoom Levels and Tile Grid](/azure/azure-maps/zoom-levels-and-tile-grid).\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\n get(\n options: RenderGetCopyrightForTileParameters,\n ): StreamableMethod<\n | RenderGetCopyrightForTile200Response\n | RenderGetCopyrightForTileDefaultResponse\n >;\n}\n\nexport interface GetCopyrightForWorld {\n /**\n *\n * Returns the copyright information for the world. To obtain the default copyright information for the whole world, don't specify a tile or bounding box.\n *\n * Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions.\n */\n get(\n options?: RenderGetCopyrightForWorldParameters,\n ): StreamableMethod<\n | RenderGetCopyrightForWorld200Response\n | RenderGetCopyrightForWorldDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/map/tile' has methods for the following verbs: get */\n (path: \"/map/tile\"): GetMapTile;\n /** Resource for '/map/tileset' has methods for the following verbs: get */\n (path: \"/map/tileset\"): GetMapTileset;\n /** Resource for '/map/attribution' has methods for the following verbs: get */\n (path: \"/map/attribution\"): GetMapAttribution;\n /** Resource for '/map/statetile' has methods for the following verbs: get */\n (path: \"/map/statetile\"): GetMapStateTile;\n /** Resource for '/map/copyright/caption/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/caption/{format}\",\n format: \"json\" | \"xml\",\n ): GetCopyrightCaption;\n /** Resource for '/map/static' has methods for the following verbs: get */\n (path: \"/map/static\"): GetMapStaticImage;\n /** Resource for '/map/copyright/bounding/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/bounding/{format}\",\n format: \"json\" | \"xml\",\n ): GetCopyrightFromBoundingBox;\n /** Resource for '/map/copyright/tile/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/tile/{format}\",\n format: \"json\" | \"xml\",\n ): GetCopyrightForTile;\n /** Resource for '/map/copyright/world/\\{format\\}' has methods for the following verbs: get */\n (\n path: \"/map/copyright/world/{format}\",\n format: \"json\" | \"xml\",\n ): GetCopyrightForWorld;\n}\n\nexport type MapsRenderClient = Client & {\n path: Routes;\n};\n"]}
|