次の方法で共有


@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

Get Copyright Caption API は、Render サービスから要求されたタイルで使用される著作権情報を提供するように設計された HTTP GET 要求です。 マップ全体の基本的な著作権に加えて、一部の国/地域の特定の著作権グループにも対応できます。

マップ要求の著作権の代わりに、プロバイダー情報をマップに表示するためのキャプションを返すこともできます。

RenderGetCopyrightCaptionDefaultResponse

Get Copyright Caption API は、Render サービスから要求されたタイルで使用される著作権情報を提供するように設計された HTTP GET 要求です。 マップ全体の基本的な著作権に加えて、一部の国/地域の特定の著作権グループにも対応できます。

マップ要求の著作権の代わりに、プロバイダー情報をマップに表示するためのキャプションを返すこともできます。

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

Get Map Attribution API を使用すると、ユーザーはタイルセットのセクションのマップ著作権属性情報を要求できます。

RenderGetMapAttributionDefaultResponse

Get Map Attribution API を使用すると、ユーザーはタイルセットのセクションのマップ著作権属性情報を要求できます。

RenderGetMapAttributionQueryParam
RenderGetMapAttributionQueryParamProperties
RenderGetMapStateTile200Headers
RenderGetMapStateTile200Response

通常、マップ コントロールまたは SDK の屋内マップ モジュールに統合するために、ベクター形式で状態タイルをフェッチします。 マップ コントロールは、ユーザーが動的スタイル設定を有効にした後、この API を呼び出します。 詳細については、「ズーム レベルとタイル グリッドのを する」を参照してください。

RenderGetMapStateTileDefaultResponse

通常、マップ コントロールまたは SDK の屋内マップ モジュールに統合するために、ベクター形式で状態タイルをフェッチします。 マップ コントロールは、ユーザーが動的スタイル設定を有効にした後、この API を呼び出します。 詳細については、「ズーム レベルとタイル グリッドのを する」を参照してください。

RenderGetMapStateTileQueryParam
RenderGetMapStateTileQueryParamProperties
RenderGetMapStaticImage200Headers
RenderGetMapStaticImage200Response

このレンダリング API は、ユーザー定義領域の静的なラスター化されたマップ ビューを生成します。 これは、軽量の Web アプリケーション、目的のユーザー エクスペリエンスで対話型のマップ コントロールが必要ない場合、または帯域幅が制限されている場合に適しています。 この API は、ブラウザーの外部のアプリケーション、バックエンド サービス、レポート生成、またはデスクトップ アプリケーションにマップを埋め込む場合にも役立ちます。

この API には、基本的なデータ視覚化のパラメーターが含まれています。

  • 複数のスタイルでラベル付けされたプッシュピン。
  • 円、パス、ポリゴン ジオメトリ タイプをレンダリングします。

詳細と詳細な例については、「ラスター マップにカスタム データをレンダリングする」を参照してください。

bbox パラメーターの寸法は、ズーム レベルに応じて制限されます。 これにより、結果の画像の詳細レベルが適切になります。

ズーム レベル 最小ロン範囲 最大ロン範囲 最小緯度範囲 最大緯度範囲
0 56.25 360.0 30.1105585173 180.0
1 28.125 360.0 14.87468995 180.0
2 14.063 351.5625 7.4130741851 137.9576312246
3 7.03125 175.78125 3.7034501005 73.6354071932
4 3.515625 87.890625 1.8513375155 35.4776115315
5 1.7578125 43.9453125 0.925620264 17.4589959239
6 0.87890625 21.97265625 0.4628040687 8.6907788223
7 0.439453125 10.986328125 0.2314012764 4.3404320789
8 0.2197265625 5.4931640625 0.1157005434 2.1695927024
9 0.1098632812 2.7465820312 0.0578502599 1.0847183194
10 0.0549316406 1.3732910156 0.0289251285 0.5423494021
11 0.0274658203 0.6866455078 0.014462564 0.2711734813
12 0.0137329102 0.3433227539 0.007231282 0.1355865882
13 0.0068664551 0.171661377 0.003615641 0.067793275
14 0.0034332275 0.0858306885 0.0018078205 0.0338966351
15 0.0017166138 0.0429153442 0.0009039102 0.0169483173
16 0.0008583069 0.0214576721 0.0004519551 0.0084741586
17 0.0004291534 0.0107288361 0.0002259776 0.0042370793
18 0.0002145767 0.005364418 0.0001129888 0.0021185396
19 0.0001072884 0.002682209 5.64944E-05 0.0010592698
20 5.36442E-05 0.0013411045 2.82472E-05 0.0005296349

: 中央 または bbox パラメーター API に指定する必要があります。

RenderGetMapStaticImageDefaultResponse

このレンダリング API は、ユーザー定義領域の静的なラスター化されたマップ ビューを生成します。 これは、軽量の Web アプリケーション、目的のユーザー エクスペリエンスで対話型のマップ コントロールが必要ない場合、または帯域幅が制限されている場合に適しています。 この API は、ブラウザーの外部のアプリケーション、バックエンド サービス、レポート生成、またはデスクトップ アプリケーションにマップを埋め込む場合にも役立ちます。

この API には、基本的なデータ視覚化のパラメーターが含まれています。

  • 複数のスタイルでラベル付けされたプッシュピン。
  • 円、パス、ポリゴン ジオメトリ タイプをレンダリングします。

詳細と詳細な例については、「ラスター マップにカスタム データをレンダリングする」を参照してください。

bbox パラメーターの寸法は、ズーム レベルに応じて制限されます。 これにより、結果の画像の詳細レベルが適切になります。

ズーム レベル 最小ロン範囲 最大ロン範囲 最小緯度範囲 最大緯度範囲
0 56.25 360.0 30.1105585173 180.0
1 28.125 360.0 14.87468995 180.0
2 14.063 351.5625 7.4130741851 137.9576312246
3 7.03125 175.78125 3.7034501005 73.6354071932
4 3.515625 87.890625 1.8513375155 35.4776115315
5 1.7578125 43.9453125 0.925620264 17.4589959239
6 0.87890625 21.97265625 0.4628040687 8.6907788223
7 0.439453125 10.986328125 0.2314012764 4.3404320789
8 0.2197265625 5.4931640625 0.1157005434 2.1695927024
9 0.1098632812 2.7465820312 0.0578502599 1.0847183194
10 0.0549316406 1.3732910156 0.0289251285 0.5423494021
11 0.0274658203 0.6866455078 0.014462564 0.2711734813
12 0.0137329102 0.3433227539 0.007231282 0.1355865882
13 0.0068664551 0.171661377 0.003615641 0.067793275
14 0.0034332275 0.0858306885 0.0018078205 0.0338966351
15 0.0017166138 0.0429153442 0.0009039102 0.0169483173
16 0.0008583069 0.0214576721 0.0004519551 0.0084741586
17 0.0004291534 0.0107288361 0.0002259776 0.0042370793
18 0.0002145767 0.005364418 0.0001129888 0.0021185396
19 0.0001072884 0.002682209 5.64944E-05 0.0010592698
20 5.36442E-05 0.0013411045 2.82472E-05 0.0005296349

: 中央 または bbox パラメーター API に指定する必要があります。

RenderGetMapStaticImageQueryParam
RenderGetMapStaticImageQueryParamProperties
RenderGetMapTile200Headers
RenderGetMapTile200Response

ユーザーがベクター形式またはラスター形式でマップ タイルを要求できる HTTP GET 要求の Get Map Tiles API は、通常、マップ コントロールまたは SDK に統合されます。 要求できるタイルの例としては、Azure Maps の道路タイル、リアルタイムの気象レーダー タイル、または Azure Maps Creator使用して作成されたマップ タイルがあります。 既定では、Azure Maps では、Web マップ コントロール (Web SDK) と Android SDKベクター タイルが使用されます。

RenderGetMapTileDefaultResponse

ユーザーがベクター形式またはラスター形式でマップ タイルを要求できる HTTP GET 要求の Get Map Tiles API は、通常、マップ コントロールまたは SDK に統合されます。 要求できるタイルの例としては、Azure Maps の道路タイル、リアルタイムの気象レーダー タイル、または Azure Maps Creator使用して作成されたマップ タイルがあります。 既定では、Azure Maps では、Web マップ コントロール (Web SDK) と Android SDKベクター タイルが使用されます。

RenderGetMapTileQueryParam
RenderGetMapTileQueryParamProperties
RenderGetMapTileset200Response

Get Map Tileset API を使用すると、ユーザーはタイルセットのメタデータを要求できます。

RenderGetMapTilesetDefaultResponse

Get Map Tileset API を使用すると、ユーザーはタイルセットのメタデータを要求できます。

RenderGetMapTilesetQueryParam
RenderGetMapTilesetQueryParamProperties
Routes

型エイリアス

MapsRenderClient
RenderGetCopyrightCaptionParameters
RenderGetCopyrightForTileParameters
RenderGetCopyrightForWorldParameters
RenderGetCopyrightFromBoundingBoxParameters
RenderGetMapAttributionParameters
RenderGetMapStateTileParameters
RenderGetMapStaticImageParameters
RenderGetMapTileParameters
RenderGetMapTilesetParameters

関数

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"));
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"));
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);
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>");
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);
isUnexpected(RenderGetMapTile200Response | RenderGetMapTileDefaultResponse)
isUnexpected(RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse)
isUnexpected(RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse)
isUnexpected(RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse)
isUnexpected(RenderGetCopyrightCaption200Response | RenderGetCopyrightCaptionDefaultResponse)
isUnexpected(RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse)
isUnexpected(RenderGetCopyrightFromBoundingBox200Response | RenderGetCopyrightFromBoundingBoxDefaultResponse)
isUnexpected(RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse)
isUnexpected(RenderGetCopyrightForWorld200Response | RenderGetCopyrightForWorldDefaultResponse)
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"));

関数の詳細

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)[]

イメージに描画 PolygonalPathCircularPath のコレクション。

戻り値

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 座標。