@azure-rest/maps-render package
インターフェイス
| CircularPath |
循環パスを指定します。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CircularPathOptions |
循環パスのスタイルを変更するオプション。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CopyrightCaptionOutput |
このオブジェクトは、正常な著作権呼び出しから返されます |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CopyrightOutput |
このオブジェクトは、正常な著作権要求から返されます |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ErrorAdditionalInfoOutput |
リソース管理エラーの追加情報。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ErrorDetailOutput |
エラーの詳細。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ErrorResponseOutput |
失敗した操作のエラーの詳細を返す、すべての Azure Resource Manager 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 座標を指定する必要があります。 詳細については、「ズーム レベルとタイル グリッドのを Copyrights API は、Render サービスの著作権情報を提供するように設計されています。 API は、マップ全体の基本的な著作権に加えて、一部の国/地域の特定の著作権グループにサービスを提供しています。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTileDefaultResponse |
特定のタイルの著作権情報を取得するには、要求でタイルのズーム レベルと x 座標と y 座標を指定する必要があります。 詳細については、「ズーム レベルとタイル グリッドのを Copyrights API は、Render サービスの著作権情報を提供するように設計されています。 API は、マップ全体の基本的な著作権に加えて、一部の国/地域の特定の著作権グループにサービスを提供しています。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTileQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTileQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorld200Response |
世界の著作権情報を返します。 全世界の既定の著作権情報を取得するには、タイルまたは境界ボックスを指定しないでください。 Copyrights API は、Render サービスの著作権情報を提供するように設計されています。 API は、マップ全体の基本的な著作権に加えて、一部の国/地域の特定の著作権グループにサービスを提供しています。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorldDefaultResponse |
世界の著作権情報を返します。 全世界の既定の著作権情報を取得するには、タイルまたは境界ボックスを指定しないでください。 Copyrights API は、Render サービスの著作権情報を提供するように設計されています。 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 には、基本的なデータ視覚化のパラメーターが含まれています。
詳細と詳細な例については、「ラスター マップにカスタム データをレンダリングする」を参照してください。
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageDefaultResponse |
このレンダリング API は、ユーザー定義領域の静的なラスター化されたマップ ビューを生成します。 これは、軽量の Web アプリケーション、目的のユーザー エクスペリエンスで対話型のマップ コントロールが必要ない場合、または帯域幅が制限されている場合に適しています。 この API は、ブラウザーの外部のアプリケーション、バックエンド サービス、レポート生成、またはデスクトップ アプリケーションにマップを埋め込む場合にも役立ちます。 この API には、基本的なデータ視覚化のパラメーターが含まれています。
詳細と詳細な例については、「ラスター マップにカスタム データをレンダリングする」を参照してください。
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTile200Headers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTile200Response |
ユーザーがベクター形式またはラスター形式でマップ タイルを要求できる HTTP GET 要求の |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileDefaultResponse |
ユーザーがベクター形式またはラスター形式でマップ タイルを要求できる HTTP GET 要求の |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileset200Response |
Get Map Tileset API を使用すると、ユーザーはタイルセットのメタデータを要求できます。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTilesetDefaultResponse |
Get Map Tileset API を使用すると、ユーザーはタイルセットのメタデータを要求できます。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTilesetQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTilesetQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Routes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
型エイリアス
関数
| create |
マップ静的イメージ 要求 例
|
| create |
マップの静的イメージを取得するためのピン クエリ文字列 作成 例
|
| default(Azure |
サブスクリプション キーから MapsRenderClient のインスタンスを作成します。 例
|
| default(Token |
Azure ID 例
|
| default(Azure |
Azure ID 例
|
| 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 ID 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 ID 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 座標。