@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
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/maps-render",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "2.0.0-beta.
|
|
5
|
+
"version": "2.0.0-beta.2",
|
|
6
6
|
"description": "A generated SDK for MapsRenderClient.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -13,40 +13,37 @@
|
|
|
13
13
|
"isomorphic"
|
|
14
14
|
],
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"module": "./dist
|
|
18
|
-
"types": "./
|
|
16
|
+
"main": "./dist/commonjs/index.js",
|
|
17
|
+
"module": "./dist/esm/index.js",
|
|
18
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
19
19
|
"repository": "github:Azure/azure-sdk-for-js",
|
|
20
20
|
"bugs": {
|
|
21
21
|
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist/",
|
|
25
|
-
"dist-esm/src/",
|
|
26
|
-
"types/maps-render-rest.d.ts",
|
|
27
25
|
"README.md",
|
|
28
|
-
"LICENSE"
|
|
29
|
-
"review/*"
|
|
26
|
+
"LICENSE"
|
|
30
27
|
],
|
|
31
28
|
"engines": {
|
|
32
29
|
"node": ">=18.0.0"
|
|
33
30
|
},
|
|
34
31
|
"scripts": {
|
|
35
|
-
"build": "npm run clean &&
|
|
36
|
-
"build:browser": "
|
|
37
|
-
"build:debug": "
|
|
38
|
-
"build:node": "
|
|
32
|
+
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
|
|
33
|
+
"build:browser": "dev-tool run build-package && dev-tool run bundle",
|
|
34
|
+
"build:debug": "dev-tool run build-package && dev-tool run bundle && dev-tool run extract-api",
|
|
35
|
+
"build:node": "dev-tool run build-package && dev-tool run bundle --browser-test false",
|
|
39
36
|
"build:samples": "dev-tool samples publish --force",
|
|
40
|
-
"build:test": "
|
|
37
|
+
"build:test": "dev-tool run build-package && dev-tool run bundle",
|
|
41
38
|
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
|
42
39
|
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
43
40
|
"execute:samples": "dev-tool samples run samples-dev",
|
|
44
|
-
"extract-api": "dev-tool run vendored rimraf review && dev-tool run
|
|
41
|
+
"extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
|
|
45
42
|
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
|
46
43
|
"generate:client": "autorest --typescript swagger/README.md && npm run format",
|
|
47
44
|
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
48
|
-
"integration-test:browser": "dev-tool run test:browser",
|
|
49
|
-
"integration-test:node": "dev-tool run test:
|
|
45
|
+
"integration-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
|
|
46
|
+
"integration-test:node": "dev-tool run test:vitest --esm",
|
|
50
47
|
"lint": "eslint package.json api-extractor.json src test",
|
|
51
48
|
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
|
|
52
49
|
"pack": "npm pack 2>&1",
|
|
@@ -54,50 +51,37 @@
|
|
|
54
51
|
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
|
|
55
52
|
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
|
|
56
53
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
57
|
-
"unit-test:browser": "dev-tool run test:browser",
|
|
58
|
-
"unit-test:node": "dev-tool run test:
|
|
59
|
-
"update-snippets": "
|
|
54
|
+
"unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
|
|
55
|
+
"unit-test:node": "dev-tool run test:vitest",
|
|
56
|
+
"update-snippets": "dev-tool run update-snippets"
|
|
60
57
|
},
|
|
61
58
|
"sideEffects": false,
|
|
62
59
|
"autoPublish": false,
|
|
63
60
|
"dependencies": {
|
|
64
|
-
"@azure-rest/core-client": "^
|
|
65
|
-
"@azure/core-auth": "^1.
|
|
66
|
-
"@azure/core-rest-pipeline": "^1.
|
|
61
|
+
"@azure-rest/core-client": "^2.3.1",
|
|
62
|
+
"@azure/core-auth": "^1.9.0",
|
|
63
|
+
"@azure/core-rest-pipeline": "^1.19.0",
|
|
64
|
+
"@azure/logger": "^1.1.4",
|
|
67
65
|
"@azure/maps-common": "1.0.0-beta.2",
|
|
68
|
-
"
|
|
69
|
-
"tslib": "^2.2.0"
|
|
66
|
+
"tslib": "^2.8.1"
|
|
70
67
|
},
|
|
71
68
|
"devDependencies": {
|
|
72
|
-
"@azure-tools/test-credential": "^
|
|
73
|
-
"@azure-tools/test-recorder": "^
|
|
74
|
-
"@azure-tools/test-utils": "^1.0.
|
|
75
|
-
"@azure/core-util": "^1.
|
|
69
|
+
"@azure-tools/test-credential": "^2.0.0",
|
|
70
|
+
"@azure-tools/test-recorder": "^4.1.0",
|
|
71
|
+
"@azure-tools/test-utils-vitest": "^1.0.0",
|
|
72
|
+
"@azure/core-util": "^1.11.0",
|
|
76
73
|
"@azure/dev-tool": "^1.0.0",
|
|
77
74
|
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
78
|
-
"@azure/identity": "^4.0
|
|
79
|
-
"@types/chai": "^4.2.8",
|
|
80
|
-
"@types/mocha": "^10.0.0",
|
|
75
|
+
"@azure/identity": "^4.6.0",
|
|
81
76
|
"@types/node": "^18.0.0",
|
|
77
|
+
"@vitest/browser": "^3.0.5",
|
|
78
|
+
"@vitest/coverage-istanbul": "^3.0.5",
|
|
82
79
|
"autorest": "latest",
|
|
83
|
-
"chai": "^4.2.0",
|
|
84
80
|
"dotenv": "^16.0.0",
|
|
85
81
|
"eslint": "^9.9.0",
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"karma-env-preprocessor": "^0.1.1",
|
|
90
|
-
"karma-firefox-launcher": "^1.1.0",
|
|
91
|
-
"karma-junit-reporter": "^2.0.1",
|
|
92
|
-
"karma-mocha": "^2.0.1",
|
|
93
|
-
"karma-mocha-reporter": "^2.2.5",
|
|
94
|
-
"karma-source-map-support": "~1.4.0",
|
|
95
|
-
"karma-sourcemap-loader": "^0.3.8",
|
|
96
|
-
"mocha": "^10.0.0",
|
|
97
|
-
"nyc": "^17.0.0",
|
|
98
|
-
"source-map-support": "^0.5.9",
|
|
99
|
-
"ts-node": "^10.0.0",
|
|
100
|
-
"typescript": "~5.6.2"
|
|
82
|
+
"playwright": "^1.50.1",
|
|
83
|
+
"typescript": "~5.7.2",
|
|
84
|
+
"vitest": "^3.0.5"
|
|
101
85
|
},
|
|
102
86
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-render-rest/README.md",
|
|
103
87
|
"//metadata": {
|
|
@@ -108,9 +92,7 @@
|
|
|
108
92
|
}
|
|
109
93
|
]
|
|
110
94
|
},
|
|
111
|
-
"browser":
|
|
112
|
-
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
|
|
113
|
-
},
|
|
95
|
+
"browser": "./dist/browser/index.js",
|
|
114
96
|
"//sampleConfiguration": {
|
|
115
97
|
"productName": "Azure Maps Render",
|
|
116
98
|
"productSlugs": [
|
|
@@ -118,8 +100,47 @@
|
|
|
118
100
|
"azure-maps"
|
|
119
101
|
],
|
|
120
102
|
"requiredResources": {
|
|
121
|
-
"Azure Maps Resource": "https://
|
|
103
|
+
"Azure Maps Resource": "https://learn.microsoft.com/azure/azure-maps/how-to-create-template"
|
|
122
104
|
},
|
|
123
105
|
"disableDocsMs": true
|
|
124
|
-
}
|
|
106
|
+
},
|
|
107
|
+
"type": "module",
|
|
108
|
+
"tshy": {
|
|
109
|
+
"project": "./tsconfig.src.json",
|
|
110
|
+
"exports": {
|
|
111
|
+
"./package.json": "./package.json",
|
|
112
|
+
".": "./src/index.ts"
|
|
113
|
+
},
|
|
114
|
+
"dialects": [
|
|
115
|
+
"esm",
|
|
116
|
+
"commonjs"
|
|
117
|
+
],
|
|
118
|
+
"esmDialects": [
|
|
119
|
+
"browser",
|
|
120
|
+
"react-native"
|
|
121
|
+
],
|
|
122
|
+
"selfLink": false
|
|
123
|
+
},
|
|
124
|
+
"exports": {
|
|
125
|
+
"./package.json": "./package.json",
|
|
126
|
+
".": {
|
|
127
|
+
"browser": {
|
|
128
|
+
"types": "./dist/browser/index.d.ts",
|
|
129
|
+
"default": "./dist/browser/index.js"
|
|
130
|
+
},
|
|
131
|
+
"react-native": {
|
|
132
|
+
"types": "./dist/react-native/index.d.ts",
|
|
133
|
+
"default": "./dist/react-native/index.js"
|
|
134
|
+
},
|
|
135
|
+
"import": {
|
|
136
|
+
"types": "./dist/esm/index.d.ts",
|
|
137
|
+
"default": "./dist/esm/index.js"
|
|
138
|
+
},
|
|
139
|
+
"require": {
|
|
140
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
141
|
+
"default": "./dist/commonjs/index.js"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"react-native": "./dist/react-native/index.js"
|
|
125
146
|
}
|
package/dist/index.js
DELETED
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var coreAuth = require('@azure/core-auth');
|
|
6
|
-
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
7
|
-
var mapsCommon = require('@azure/maps-common');
|
|
8
|
-
var tslib = require('tslib');
|
|
9
|
-
var coreClient = require('@azure-rest/core-client');
|
|
10
|
-
var logger$1 = require('@azure/logger');
|
|
11
|
-
|
|
12
|
-
// Copyright (c) Microsoft Corporation.
|
|
13
|
-
// Licensed under the MIT License.
|
|
14
|
-
const logger = logger$1.createClientLogger("maps-render");
|
|
15
|
-
|
|
16
|
-
// Copyright (c) Microsoft Corporation.
|
|
17
|
-
// Licensed under the MIT License.
|
|
18
|
-
/**
|
|
19
|
-
* Initialize a new instance of `MapsRenderClient`
|
|
20
|
-
* @param credentials - uniquely identify client credential
|
|
21
|
-
* @param options - the parameter for all optional parameters
|
|
22
|
-
*/
|
|
23
|
-
function createClient(credentials, _a = {}) {
|
|
24
|
-
var _b, _c, _d, _e, _f, _g;
|
|
25
|
-
var { apiVersion = "2024-04-01" } = _a, options = tslib.__rest(_a, ["apiVersion"]);
|
|
26
|
-
const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `https://atlas.microsoft.com`;
|
|
27
|
-
const userAgentInfo = `azsdk-js-maps-render-rest/2.0.0-beta.1`;
|
|
28
|
-
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
29
|
-
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
30
|
-
: `${userAgentInfo}`;
|
|
31
|
-
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
32
|
-
userAgentPrefix,
|
|
33
|
-
}, loggingOptions: {
|
|
34
|
-
logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
|
|
35
|
-
}, credentials: {
|
|
36
|
-
apiKeyHeaderName: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.apiKeyHeaderName) !== null && _g !== void 0 ? _g : "subscription-key",
|
|
37
|
-
} });
|
|
38
|
-
const client = coreClient.getClient(endpointUrl, credentials, options);
|
|
39
|
-
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
40
|
-
client.pipeline.addPolicy({
|
|
41
|
-
name: "ClientApiVersionPolicy",
|
|
42
|
-
sendRequest: (req, next) => {
|
|
43
|
-
// Use the apiVersion defined in request url directly
|
|
44
|
-
// Append one if there is no apiVersion and we have one at client options
|
|
45
|
-
const url = new URL(req.url);
|
|
46
|
-
if (!url.searchParams.get("api-version") && apiVersion) {
|
|
47
|
-
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
|
|
48
|
-
}
|
|
49
|
-
return next(req);
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
return client;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Copyright (c) Microsoft Corporation.
|
|
56
|
-
// Licensed under the MIT License.
|
|
57
|
-
function MapsRender(credential, clientIdOrOptions = {}, maybeOptions = {}) {
|
|
58
|
-
const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
|
|
59
|
-
/**
|
|
60
|
-
* maps service requires a header "ms-x-client-id", which is different from the standard Microsoft Entra ID.
|
|
61
|
-
* So we need to do our own implementation.
|
|
62
|
-
* This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication
|
|
63
|
-
*/
|
|
64
|
-
if (coreAuth.isTokenCredential(credential)) {
|
|
65
|
-
const clientId = typeof clientIdOrOptions === "string" ? clientIdOrOptions : "";
|
|
66
|
-
if (!clientId) {
|
|
67
|
-
throw Error("Client id is needed for TokenCredential");
|
|
68
|
-
}
|
|
69
|
-
const client = createClient(undefined, options);
|
|
70
|
-
client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
71
|
-
credential,
|
|
72
|
-
scopes: "https://atlas.microsoft.com/.default",
|
|
73
|
-
}));
|
|
74
|
-
client.pipeline.addPolicy(mapsCommon.createMapsClientIdPolicy(clientId));
|
|
75
|
-
return client;
|
|
76
|
-
}
|
|
77
|
-
if (coreAuth.isSASCredential(credential)) {
|
|
78
|
-
const client = createClient(undefined, options);
|
|
79
|
-
client.pipeline.addPolicy({
|
|
80
|
-
name: "mapsSASCredentialPolicy",
|
|
81
|
-
async sendRequest(request, next) {
|
|
82
|
-
request.headers.set("Authorization", `jwt-sas ${credential.signature}`);
|
|
83
|
-
return next(request);
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
return client;
|
|
87
|
-
}
|
|
88
|
-
return createClient(credential, options);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Copyright (c) Microsoft Corporation.
|
|
92
|
-
// Licensed under the MIT License.
|
|
93
|
-
const responseMap = {
|
|
94
|
-
"GET /map/tile": ["200"],
|
|
95
|
-
"GET /map/tileset": ["200"],
|
|
96
|
-
"GET /map/attribution": ["200"],
|
|
97
|
-
"GET /map/statetile": ["200"],
|
|
98
|
-
"GET /map/copyright/caption/{format}": ["200"],
|
|
99
|
-
"GET /map/static": ["200"],
|
|
100
|
-
"GET /map/copyright/bounding/{format}": ["200"],
|
|
101
|
-
"GET /map/copyright/tile/{format}": ["200"],
|
|
102
|
-
"GET /map/copyright/world/{format}": ["200"],
|
|
103
|
-
};
|
|
104
|
-
function isUnexpected(response) {
|
|
105
|
-
const lroOriginal = response.headers["x-ms-original-url"];
|
|
106
|
-
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
107
|
-
const method = response.request.method;
|
|
108
|
-
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
109
|
-
if (!pathDetails) {
|
|
110
|
-
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
111
|
-
}
|
|
112
|
-
return !pathDetails.includes(response.status);
|
|
113
|
-
}
|
|
114
|
-
function getParametrizedPathSuccess(method, path) {
|
|
115
|
-
var _a, _b, _c, _d;
|
|
116
|
-
const pathParts = path.split("/");
|
|
117
|
-
// Traverse list to match the longest candidate
|
|
118
|
-
// matchedLen: the length of candidate path
|
|
119
|
-
// matchedValue: the matched status code array
|
|
120
|
-
let matchedLen = -1, matchedValue = [];
|
|
121
|
-
// Iterate the responseMap to find a match
|
|
122
|
-
for (const [key, value] of Object.entries(responseMap)) {
|
|
123
|
-
// Extracting the path from the map key which is in format
|
|
124
|
-
// GET /path/foo
|
|
125
|
-
if (!key.startsWith(method)) {
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
const candidatePath = getPathFromMapKey(key);
|
|
129
|
-
// Get each part of the url path
|
|
130
|
-
const candidateParts = candidatePath.split("/");
|
|
131
|
-
// track if we have found a match to return the values found.
|
|
132
|
-
let found = true;
|
|
133
|
-
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
134
|
-
if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
|
|
135
|
-
((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
|
|
136
|
-
const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
|
|
137
|
-
// If the current part of the candidate is a "template" part
|
|
138
|
-
// Try to use the suffix of pattern to match the path
|
|
139
|
-
// {guid} ==> $
|
|
140
|
-
// {guid}:export ==> :export$
|
|
141
|
-
const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
|
|
142
|
-
if (!isMatched) {
|
|
143
|
-
found = false;
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
// If the candidate part is not a template and
|
|
149
|
-
// the parts don't match mark the candidate as not found
|
|
150
|
-
// to move on with the next candidate path.
|
|
151
|
-
if (candidateParts[i] !== pathParts[j]) {
|
|
152
|
-
found = false;
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
// We finished evaluating the current candidate parts
|
|
157
|
-
// Update the matched value if and only if we found the longer pattern
|
|
158
|
-
if (found && candidatePath.length > matchedLen) {
|
|
159
|
-
matchedLen = candidatePath.length;
|
|
160
|
-
matchedValue = value;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return matchedValue;
|
|
164
|
-
}
|
|
165
|
-
function getPathFromMapKey(mapKey) {
|
|
166
|
-
const pathStart = mapKey.indexOf("/");
|
|
167
|
-
return mapKey.slice(pathStart);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// Copyright (c) Microsoft Corporation.
|
|
171
|
-
// Licensed under the MIT License.
|
|
172
|
-
function clip(n, minValue, maxValue) {
|
|
173
|
-
return Math.min(Math.max(n, minValue), maxValue);
|
|
174
|
-
}
|
|
175
|
-
const MIN_LATITUDE = -85.05112878;
|
|
176
|
-
const MAX_LATITUDE = 85.05112878;
|
|
177
|
-
const MIN_LONGITUDE = -180;
|
|
178
|
-
const MAX_LONGITUDE = 180;
|
|
179
|
-
/**
|
|
180
|
-
* Calculates the XY tile coordinates that a coordinate falls into for a specific zoom level.
|
|
181
|
-
* Reference: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code
|
|
182
|
-
*
|
|
183
|
-
* @example
|
|
184
|
-
* ```ts
|
|
185
|
-
* const zoom = 6;
|
|
186
|
-
* const { x, y } = positionToTileXY([47.61559, -122.33817], 6, "256");
|
|
187
|
-
* const response = await client
|
|
188
|
-
* .path("/map/tile")
|
|
189
|
-
* .get({
|
|
190
|
-
* queryParameters: { tilesetId: "microsoft.base.road", zoom, x, y },
|
|
191
|
-
* })
|
|
192
|
-
* ```
|
|
193
|
-
*
|
|
194
|
-
* @param position - Position coordinate in the format [latitude, longitude].
|
|
195
|
-
* @param zoom - Zoom level.
|
|
196
|
-
* @param tileSize - The size of the tiles in the tile pyramid.
|
|
197
|
-
* @returns Tile XY coordinates.
|
|
198
|
-
*/
|
|
199
|
-
function positionToTileXY(position, zoom, tileSize) {
|
|
200
|
-
const latitude = clip(position[0], MIN_LATITUDE, MAX_LATITUDE);
|
|
201
|
-
const longitude = clip(position[1], MIN_LONGITUDE, MAX_LONGITUDE);
|
|
202
|
-
const x = (longitude + 180) / 360;
|
|
203
|
-
const sinLatitude = Math.sin((latitude * Math.PI) / 180);
|
|
204
|
-
const y = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);
|
|
205
|
-
const tileSizeInNum = parseInt(tileSize);
|
|
206
|
-
// 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.
|
|
207
|
-
const mapSize = Math.ceil(tileSizeInNum * Math.pow(2, zoom));
|
|
208
|
-
return {
|
|
209
|
-
x: Math.floor(clip(x * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),
|
|
210
|
-
y: Math.floor(clip(y * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Copyright (c) Microsoft Corporation.
|
|
215
|
-
// Licensed under the MIT License.
|
|
216
|
-
/**
|
|
217
|
-
* @internal
|
|
218
|
-
* Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).
|
|
219
|
-
* This should be removed once the core-client support collectionFormat: multi.
|
|
220
|
-
*/
|
|
221
|
-
function createMultiCollection(key, values) {
|
|
222
|
-
return values.slice(1).reduce((acc, value) => {
|
|
223
|
-
return `${acc}&${key}=${value}`;
|
|
224
|
-
}, values[0] || "");
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Copyright (c) Microsoft Corporation.
|
|
228
|
-
// Licensed under the MIT License.
|
|
229
|
-
const optionKeyMap$1 = {
|
|
230
|
-
opacity: "al",
|
|
231
|
-
labelAnchor: "la",
|
|
232
|
-
labelColor: "lc",
|
|
233
|
-
labelSizeInPixels: "ls",
|
|
234
|
-
pinAnchor: "an",
|
|
235
|
-
rotationInDegree: "ro",
|
|
236
|
-
scale: "sc",
|
|
237
|
-
pinColor: "co",
|
|
238
|
-
};
|
|
239
|
-
function isOptionKeyMap(key) {
|
|
240
|
-
return key in optionKeyMap$1;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Create a pin query string for _get map static image_
|
|
244
|
-
*
|
|
245
|
-
* @example
|
|
246
|
-
* ```ts
|
|
247
|
-
*
|
|
248
|
-
* const pins = {
|
|
249
|
-
* pins: [
|
|
250
|
-
* { coordinate: [52.577, 13.35], label: "Label start" },
|
|
251
|
-
* { coordinate: [52.6, 13.2988], label: "Label end" },
|
|
252
|
-
* ],
|
|
253
|
-
* pinImage: "<image source url || default || none>"
|
|
254
|
-
* options: {
|
|
255
|
-
* scale: 0.9,
|
|
256
|
-
* pinColor: "FF0000",
|
|
257
|
-
* labelColor: "0000FF",
|
|
258
|
-
* labelSizeInPixels: 18,
|
|
259
|
-
* }
|
|
260
|
-
* );
|
|
261
|
-
* const res = await client
|
|
262
|
-
* .path("/map/static/{format}", "png")
|
|
263
|
-
* .get({
|
|
264
|
-
* queryParameters: {
|
|
265
|
-
* bbox: [13.228, 52.4559, 13.5794, 52.62],
|
|
266
|
-
* zoom: 10,
|
|
267
|
-
* pins: pins,
|
|
268
|
-
* },
|
|
269
|
-
* skipUrlEncoding: true,
|
|
270
|
-
* })
|
|
271
|
-
* ```
|
|
272
|
-
*
|
|
273
|
-
* @param pins - An array of {@link Pin} that specify the positions and label text of each pin.
|
|
274
|
-
* @param pinImage - Specify the image source for custom pin. Set this to "none" if you don't want to show a pin image.
|
|
275
|
-
* @param options - The style options of the pins. See {@link PinOptions}
|
|
276
|
-
* @returns - The composed query string.
|
|
277
|
-
*/
|
|
278
|
-
function createPinsQuery(pinSets) {
|
|
279
|
-
const pinsQueries = pinSets.map(({ pins, pinImage = "default", options = {} }) => {
|
|
280
|
-
// compose the pins' position query string
|
|
281
|
-
const pinsQueryStr = pins
|
|
282
|
-
.map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : ""}${lon} ${lat}`)
|
|
283
|
-
.join("|");
|
|
284
|
-
// compose the options query string
|
|
285
|
-
const optionsQueryStr = Object.entries(options).reduce((queryStr, [key, val]) => {
|
|
286
|
-
if (!isOptionKeyMap(key))
|
|
287
|
-
throw Error(`Unexpected option: ${key}`);
|
|
288
|
-
if (Array.isArray(val))
|
|
289
|
-
return (queryStr += `|${optionKeyMap$1[key]}${val[0]} ${val[1]}`);
|
|
290
|
-
return (queryStr += `|${optionKeyMap$1[key]}${val}`);
|
|
291
|
-
}, "");
|
|
292
|
-
if (pinImage === "none" || pinImage === "default") {
|
|
293
|
-
return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;
|
|
294
|
-
}
|
|
295
|
-
return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;
|
|
296
|
-
});
|
|
297
|
-
return createMultiCollection("pins", pinsQueries);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// Copyright (c) Microsoft Corporation.
|
|
301
|
-
// Licensed under the MIT License.
|
|
302
|
-
function isCircularPath(path) {
|
|
303
|
-
return "center" in path;
|
|
304
|
-
}
|
|
305
|
-
const optionKeyMap = {
|
|
306
|
-
lineColor: "lc",
|
|
307
|
-
lineOpacity: "la",
|
|
308
|
-
fillColor: "fc",
|
|
309
|
-
fillOpacity: "fa",
|
|
310
|
-
lineWidthInPixels: "lw",
|
|
311
|
-
radius: "ra",
|
|
312
|
-
};
|
|
313
|
-
function isOptionKey(key) {
|
|
314
|
-
return key in optionKeyMap;
|
|
315
|
-
}
|
|
316
|
-
function comosePathVal(coordinates, options) {
|
|
317
|
-
// compose the coordinates query string
|
|
318
|
-
const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join("|");
|
|
319
|
-
// compose the options query string
|
|
320
|
-
const optionsQueryStr = Object.entries(options).reduce((queryStr, [key, val]) => {
|
|
321
|
-
if (!isOptionKey(key))
|
|
322
|
-
throw Error(`Unknown key ${key}`);
|
|
323
|
-
queryStr += `${queryStr ? "|" : ""}${optionKeyMap[key]}${val}`;
|
|
324
|
-
return queryStr;
|
|
325
|
-
}, "");
|
|
326
|
-
return optionsQueryStr + "||" + coordinatesQueryStr;
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Create a path query string for _get map static image_ request.
|
|
330
|
-
*
|
|
331
|
-
* @example
|
|
332
|
-
* ```ts
|
|
333
|
-
* const circularPath = {
|
|
334
|
-
* center: [52.4559, 13.228],
|
|
335
|
-
* radiusInMeters: 10000,
|
|
336
|
-
* options: {
|
|
337
|
-
* lineColor: "000000",
|
|
338
|
-
* lineOpacity: 0.9,
|
|
339
|
-
* lineWidthInPixels: 2,
|
|
340
|
-
* },
|
|
341
|
-
* };
|
|
342
|
-
*
|
|
343
|
-
* const linearPath = {
|
|
344
|
-
* coordinates: [
|
|
345
|
-
* [52.577, 13.35],
|
|
346
|
-
* [52.6, 13.2988],
|
|
347
|
-
* [52.32, 13.2988],
|
|
348
|
-
* ],
|
|
349
|
-
* options: {
|
|
350
|
-
* lineColor: "000000",
|
|
351
|
-
* lineOpacity: 0.9,
|
|
352
|
-
* lineWidthInPixels: 2,
|
|
353
|
-
* },
|
|
354
|
-
* };
|
|
355
|
-
*
|
|
356
|
-
* const polygonPath = {
|
|
357
|
-
* coordinates: [
|
|
358
|
-
* [52.577, 13.35],
|
|
359
|
-
* [52.6, 13.2988],
|
|
360
|
-
* [52.32, 13.2988],
|
|
361
|
-
* [52.577, 13.35],
|
|
362
|
-
* ],
|
|
363
|
-
* options: {
|
|
364
|
-
* lineColor: "000000",
|
|
365
|
-
* lineOpacity: 0.9,
|
|
366
|
-
* lineWidthInPixels: 2,
|
|
367
|
-
* fillColor: "FFFFFF",
|
|
368
|
-
* fillOpacity: 0.8,
|
|
369
|
-
* },
|
|
370
|
-
* };
|
|
371
|
-
*
|
|
372
|
-
* const path = createPathQuery([circularPath, linearPath, polygonPath]);
|
|
373
|
-
* // Send the request
|
|
374
|
-
* const response = await client.path("/map/static/{format}", "png").get({
|
|
375
|
-
* queryParameters: {
|
|
376
|
-
* bbox: [13.228,52.4559,13.5794,52.629],
|
|
377
|
-
* path: path
|
|
378
|
-
* }
|
|
379
|
-
* });
|
|
380
|
-
* ```
|
|
381
|
-
*
|
|
382
|
-
* @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.
|
|
383
|
-
* @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.
|
|
384
|
-
*/
|
|
385
|
-
function createPathQuery(paths) {
|
|
386
|
-
const pathQueries = paths.map((path) => {
|
|
387
|
-
if (isCircularPath(path)) {
|
|
388
|
-
const { center, radiusInMeters, options } = path;
|
|
389
|
-
return comosePathVal([center], Object.assign(Object.assign({}, options), { radius: radiusInMeters }));
|
|
390
|
-
}
|
|
391
|
-
return comosePathVal(path.coordinates, path.options || {});
|
|
392
|
-
});
|
|
393
|
-
return createMultiCollection("path", pathQueries);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
// Copyright (c) Microsoft Corporation.
|
|
397
|
-
// Licensed under the MIT License.
|
|
398
|
-
|
|
399
|
-
exports.createPathQuery = createPathQuery;
|
|
400
|
-
exports.createPinsQuery = createPinsQuery;
|
|
401
|
-
exports.default = MapsRender;
|
|
402
|
-
exports.isUnexpected = isUnexpected;
|
|
403
|
-
exports.positionToTileXY = positionToTileXY;
|
|
404
|
-
//# sourceMappingURL=index.js.map
|