@azure-rest/maps-render package
接口
| CircularPath |
指定循环路径。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CircularPathOptions |
修改循环路径样式的选项。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CopyrightCaptionOutput |
此对象从成功的版权调用返回 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CopyrightOutput |
此对象是从成功的版权请求返回的 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ErrorAdditionalInfoOutput |
资源管理错误附加信息。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ErrorDetailOutput |
错误详细信息。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ErrorResponseOutput |
所有 Azure 资源管理器 API 的常见错误响应,以返回失败操作的错误详细信息。 (这也遵循 OData 错误响应格式)。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetCopyrightCaption | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetCopyrightForTile | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetCopyrightForWorld | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetCopyrightFromBoundingBox | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapAttribution | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapStateTile | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapStaticImage | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapTile | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapTileset | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MapAttributionOutput |
图块集所请求部分的版权归属。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MapTilesetOutput |
TileJSON 格式的图块集的元数据。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MapsRenderClientOptions |
客户端的可选参数 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pin |
指定图钉的位置和标签文本的方式。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PinOptions |
默认/无图像样式的固定选项。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PinSet | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PolygonalPath |
指定多边形路径。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PolygonalPathOptions |
修改多边形路径样式的选项。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RegionCopyrightsCountryOutput |
Country 属性 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RegionCopyrightsOutput | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightCaption200Response |
作为地图请求版权的替代方法,它还可以返回用于在地图上显示提供程序信息的标题。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightCaptionDefaultResponse |
作为地图请求版权的替代方法,它还可以返回用于在地图上显示提供程序信息的标题。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTile200Response |
若要获取特定磁贴的版权信息,请求应指定磁贴的缩放级别和 x 和 y 坐标。 有关详细信息,请参阅 缩放级别和磁贴网格。 版权 API 旨在为呈现服务提供版权信息。 除了整个地图的基本版权外,API 还为一些国家/地区提供特定版权组。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTileDefaultResponse |
若要获取特定磁贴的版权信息,请求应指定磁贴的缩放级别和 x 和 y 坐标。 有关详细信息,请参阅 缩放级别和磁贴网格。 版权 API 旨在为呈现服务提供版权信息。 除了整个地图的基本版权外,API 还为一些国家/地区提供特定版权组。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTileQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTileQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorld200Response |
返回世界的版权信息。 若要获取全世界的默认版权信息,请不要指定磁贴或边界框。 版权 API 旨在为呈现服务提供版权信息。 除了整个地图的基本版权外,API 还为一些国家/地区提供特定版权组。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorldDefaultResponse |
返回世界的版权信息。 若要获取全世界的默认版权信息,请不要指定磁贴或边界框。 版权 API 旨在为呈现服务提供版权信息。 除了整个地图的基本版权外,API 还为一些国家/地区提供特定版权组。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorldQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorldQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightFromBoundingBox200Response |
返回给定边界框的版权信息。 边界框请求应指定最小和最大经度和纬度 (EPSG-3857) 坐标 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightFromBoundingBoxDefaultResponse |
返回给定边界框的版权信息。 边界框请求应指定最小和最大经度和纬度 (EPSG-3857) 坐标 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightFromBoundingBoxQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightFromBoundingBoxQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapAttribution200Response |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapAttributionDefaultResponse |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapAttributionQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapAttributionQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTile200Headers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTile200Response |
提取矢量格式的状态磁贴通常要集成到地图控件或 SDK 的室内地图模块中。 用户启用动态样式设置后,地图控件将调用此 API。 有关详细信息,请参阅 缩放级别和磁贴网格。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTileDefaultResponse |
提取矢量格式的状态磁贴通常要集成到地图控件或 SDK 的室内地图模块中。 用户启用动态样式设置后,地图控件将调用此 API。 有关详细信息,请参阅 缩放级别和磁贴网格。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTileQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTileQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImage200Headers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImage200Response |
此呈现 API 生成用户定义的区域的静态光栅化地图视图。 它适用于轻型 Web 应用程序,当所需的用户体验不需要交互式地图控件或带宽受限时。 此 API 还可用于在浏览器外部、后端服务、报表生成或桌面应用程序中嵌入映射。 此 API 包括基本数据可视化的参数:
有关详细信息和详细示例,请参阅 光栅地图上呈现自定义数据。
注意:必须向 API 提供 中心 或 bbox 参数。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageDefaultResponse |
此呈现 API 生成用户定义的区域的静态光栅化地图视图。 它适用于轻型 Web 应用程序,当所需的用户体验不需要交互式地图控件或带宽受限时。 此 API 还可用于在浏览器外部、后端服务、报表生成或桌面应用程序中嵌入映射。 此 API 包括基本数据可视化的参数:
有关详细信息和详细示例,请参阅 光栅地图上呈现自定义数据。
注意:必须向 API 提供 中心 或 bbox 参数。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTile200Headers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTile200Response |
HTTP GET 请求中的 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileDefaultResponse |
HTTP GET 请求中的 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileset200Response |
获取地图图块集 API 允许用户请求图块集的元数据。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTilesetDefaultResponse |
获取地图图块集 API 允许用户请求图块集的元数据。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTilesetQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTilesetQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Routes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
类型别名
函数
| create |
为 获取地图静态图像 请求创建路径查询字符串。 示例
|
| create |
为 获取地图静态图像创建固定查询字符串 示例
|
| default(Azure |
从订阅密钥创建 MapsRenderClient 的实例。 示例
|
| default(Token |
从 Azure 标识 示例
|
| default(Azure |
从 Azure 标识 示例
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| position |
计算坐标在特定缩放级别所属于的 XY 磁贴坐标。 参考:https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code 示例
|
函数详细信息
createPathQuery((PolygonalPath | CircularPath)[])
为 获取地图静态图像 请求创建路径查询字符串。
示例
import { DefaultAzureCredential } from "@azure/identity";
import MapsRender, { CircularPath, PolygonalPath, createPathQuery } from "@azure-rest/maps-render";
import { createWriteStream } from "node:fs";
const credential = new DefaultAzureCredential();
const client = MapsRender(credential, "<maps-account-client-id>");
const circularPath: CircularPath = {
center: [52.4559, 13.228],
radiusInMeters: 10000,
options: {
lineColor: "000000",
lineOpacity: 0.9,
lineWidthInPixels: 2,
},
};
const linearPath: PolygonalPath = {
coordinates: [
[52.577, 13.35],
[52.6, 13.2988],
[52.32, 13.2988],
],
options: {
lineColor: "000000",
lineOpacity: 0.9,
lineWidthInPixels: 2,
},
};
const polygonPath: PolygonalPath = {
coordinates: [
[52.577, 13.35],
[52.6, 13.2988],
[52.32, 13.2988],
[52.577, 13.35],
],
options: {
lineColor: "000000",
lineOpacity: 0.9,
lineWidthInPixels: 2,
fillColor: "FFFFFF",
fillOpacity: 0.8,
},
};
const path = createPathQuery([circularPath, linearPath, polygonPath]);
// Send the request
const response = await client
.path("/map/static")
.get({
queryParameters: {
bbox: [13.228, 52.4559, 13.5794, 52.629],
path,
},
})
.asNodeStream();
// Handle the error.
if (!response.body) {
throw Error("No response body");
}
response.body.pipe(createWriteStream("path.png"));
function createPathQuery(paths: (PolygonalPath | CircularPath)[]): string
参数
- paths
-
(PolygonalPath | CircularPath)[]
要绘制在图像上的 PolygonalPath 和 CircularPath 的集合。
返回
string
createPinsQuery(PinSet[])
为 获取地图静态图像创建固定查询字符串
示例
import { DefaultAzureCredential } from "@azure/identity";
import MapsRender, { PinSet, createPinsQuery } from "@azure-rest/maps-render";
import { createWriteStream } from "node:fs";
const credential = new DefaultAzureCredential();
const client = MapsRender(credential, "<maps-account-client-id>");
const pins: PinSet[] = [
{
pins: [
{ coordinate: [52.577, 13.35], label: "Label start" },
{ coordinate: [52.6, 13.2988], label: "Label end" },
],
pinImage: "default",
options: {
scale: 0.9,
pinColor: "FF0000",
labelColor: "0000FF",
labelSizeInPixels: 18,
},
},
];
const path = createPinsQuery(pins);
const response = await client
.path("/map/static")
.get({
queryParameters: {
bbox: [13.228, 52.4559, 13.5794, 52.62],
zoom: 10,
path,
},
skipUrlEncoding: true,
})
.asNodeStream();
// Handle the error.
if (!response.body) {
throw Error("No response body");
}
response.body.pipe(createWriteStream("pin.png"));
function createPinsQuery(pinSets: PinSet[]): string
参数
- pinSets
-
PinSet[]
返回
string
- 组合查询字符串。
default(AzureKeyCredential, ClientOptions)
从订阅密钥创建 MapsRenderClient 的实例。
示例
import { AzureKeyCredential } from "@azure/core-auth";
import MapsRender from "@azure-rest/maps-render";
const credential = new AzureKeyCredential("<subscription-key>");
const client = MapsRender(credential);
function default(credential: AzureKeyCredential, options?: ClientOptions): MapsRenderClient
参数
- credential
- AzureKeyCredential
用于对服务请求进行身份验证的 AzureKeyCredential 实例
- options
- ClientOptions
用于配置呈现客户端的选项
返回
default(TokenCredential, string, ClientOptions)
从 Azure 标识 TokenCredential创建 MapsRender 实例。
示例
import { DefaultAzureCredential } from "@azure/identity";
import MapsRender from "@azure-rest/maps-render";
const credential = new DefaultAzureCredential();
const client = MapsRender(credential, "<maps-account-client-id>");
function default(credential: TokenCredential, mapsAccountClientId: string, options?: ClientOptions): MapsRenderClient
参数
- credential
- TokenCredential
用于对服务的请求进行身份验证的 TokenCredential 实例
- mapsAccountClientId
-
string
特定地图资源的 Azure Maps 客户端 ID
- options
- ClientOptions
用于配置呈现客户端的选项
返回
default(AzureSASCredential, ClientOptions)
从 Azure 标识 AzureSASCredential创建 MapsRender 实例。
示例
import { AzureSASCredential } from "@azure/core-auth";
import MapsRender from "@azure-rest/maps-render";
const credential = new AzureSASCredential("<SAS Token>");
const client = MapsRender(credential);
function default(credential: AzureSASCredential, options?: ClientOptions): MapsRenderClient
参数
- credential
- AzureSASCredential
用于对服务的请求进行身份验证的 AzureSASCredential 实例
- options
- ClientOptions
用于配置呈现客户端的选项
返回
isUnexpected(RenderGetMapTile200Response | RenderGetMapTileDefaultResponse)
function isUnexpected(response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse): response
参数
返回
response
isUnexpected(RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse)
function isUnexpected(response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse): response
参数
返回
response
isUnexpected(RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse)
function isUnexpected(response: RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse): response
参数
返回
response
isUnexpected(RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse)
function isUnexpected(response: RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse): response
参数
返回
response
isUnexpected(RenderGetCopyrightCaption200Response | RenderGetCopyrightCaptionDefaultResponse)
function isUnexpected(response: RenderGetCopyrightCaption200Response | RenderGetCopyrightCaptionDefaultResponse): response
参数
返回
response
isUnexpected(RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse)
function isUnexpected(response: RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse): response
参数
返回
response
isUnexpected(RenderGetCopyrightFromBoundingBox200Response | RenderGetCopyrightFromBoundingBoxDefaultResponse)
function isUnexpected(response: RenderGetCopyrightFromBoundingBox200Response | RenderGetCopyrightFromBoundingBoxDefaultResponse): response
参数
返回
response
isUnexpected(RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse)
function isUnexpected(response: RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse): response
参数
返回
response
isUnexpected(RenderGetCopyrightForWorld200Response | RenderGetCopyrightForWorldDefaultResponse)
function isUnexpected(response: RenderGetCopyrightForWorld200Response | RenderGetCopyrightForWorldDefaultResponse): response
参数
返回
response
positionToTileXY(LatLon, number, "256" | "512")
计算坐标在特定缩放级别所属于的 XY 磁贴坐标。 参考:https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code
示例
import { DefaultAzureCredential } from "@azure/identity";
import MapsRender, { positionToTileXY } from "@azure-rest/maps-render";
import { createWriteStream } from "node:fs";
const credential = new DefaultAzureCredential();
const client = MapsRender(credential, "<maps-account-client-id>");
const zoom = 6;
// Use the helper function `positionToTileXY` to get the tile index from the coordinate.
const { x, y } = positionToTileXY([47.61559, -122.33817], 6, "256");
const response = await client
.path("/map/tile")
.get({
queryParameters: {
tilesetId: "microsoft.base.road",
zoom,
x,
y,
},
})
.asNodeStream();
// Handle the error.
if (!response.body) {
throw Error("No response body");
}
response.body.pipe(createWriteStream("tile.png"));
function positionToTileXY(position: LatLon, zoom: number, tileSize: "256" | "512"): { x: number, y: number }
参数
- position
- LatLon
位置坐标格式为 [纬度, 经度]。
- zoom
-
number
缩放级别。
- tileSize
-
"256" | "512"
图块棱锥图中的磁贴大小。
返回
{ x: number, y: number }
平铺 XY 坐标。