Bagikan melalui


@azure-rest/maps-render package

Antarmuka

CircularPath

Tentukan jalur melingkar.

CircularPathOptions

Opsi yang memodifikasi gaya jalur melingkar.

CopyrightCaptionOutput

Objek ini dikembalikan dari panggilan hak cipta yang berhasil

CopyrightOutput

Objek ini dikembalikan dari permintaan hak cipta yang berhasil

ErrorAdditionalInfoOutput

Info tambahan kesalahan manajemen sumber daya.

ErrorDetailOutput

Detail kesalahan.

ErrorResponseOutput

Respons kesalahan umum untuk semua API Azure Resource Manager untuk mengembalikan detail kesalahan untuk operasi yang gagal. (Ini juga mengikuti format respons kesalahan OData.).

GetCopyrightCaption
GetCopyrightForTile
GetCopyrightForWorld
GetCopyrightFromBoundingBox
GetMapAttribution
GetMapStateTile
GetMapStaticImage
GetMapTile
GetMapTileset
MapAttributionOutput

Atribusi hak cipta untuk bagian yang diminta dari tileset.

MapTilesetOutput

Metadata untuk tileset dalam format TileJSON.

MapsRenderClientOptions

Parameter opsional untuk klien

Pin

Tentukan bagaimana posisi pin dan teks label.

PinOptions

Opsi sematkan untuk gaya gambar default/tidak ada..

PinSet
PolygonalPath

Tentukan jalur poligonal.

PolygonalPathOptions

Opsi yang memodifikasi gaya jalur poligonal.

RegionCopyrightsCountryOutput

Properti negara

RegionCopyrightsOutput
RenderGetCopyrightCaption200Response

API Get Copyright Caption adalah permintaan HTTP GET yang dirancang untuk melayani informasi hak cipta yang akan digunakan dengan petak peta yang diminta dari layanan Render. Selain hak cipta dasar untuk seluruh peta, ini dapat melayani kelompok hak cipta tertentu untuk beberapa negara/wilayah.

Sebagai alternatif untuk hak cipta untuk permintaan peta, ia juga dapat mengembalikan keterangan untuk menampilkan informasi penyedia di peta.

RenderGetCopyrightCaptionDefaultResponse

API Get Copyright Caption adalah permintaan HTTP GET yang dirancang untuk melayani informasi hak cipta yang akan digunakan dengan petak peta yang diminta dari layanan Render. Selain hak cipta dasar untuk seluruh peta, ini dapat melayani kelompok hak cipta tertentu untuk beberapa negara/wilayah.

Sebagai alternatif untuk hak cipta untuk permintaan peta, ia juga dapat mengembalikan keterangan untuk menampilkan informasi penyedia di peta.

RenderGetCopyrightForTile200Response

Untuk mendapatkan informasi hak cipta untuk petak peta tertentu, permintaan harus menentukan tingkat pembesaran tampilan petak peta dan koordinat x dan y. Untuk informasi selengkapnya, lihat Tingkat Zoom dan Kisi Petak peta.

Copyrights API dirancang untuk menyajikan informasi hak cipta untuk layanan Render. Selain hak cipta dasar untuk seluruh peta, API melayani grup hak cipta tertentu untuk beberapa negara/wilayah.

RenderGetCopyrightForTileDefaultResponse

Untuk mendapatkan informasi hak cipta untuk petak peta tertentu, permintaan harus menentukan tingkat pembesaran tampilan petak peta dan koordinat x dan y. Untuk informasi selengkapnya, lihat Tingkat Zoom dan Kisi Petak peta.

Copyrights API dirancang untuk menyajikan informasi hak cipta untuk layanan Render. Selain hak cipta dasar untuk seluruh peta, API melayani grup hak cipta tertentu untuk beberapa negara/wilayah.

RenderGetCopyrightForTileQueryParam
RenderGetCopyrightForTileQueryParamProperties
RenderGetCopyrightForWorld200Response

Mengembalikan informasi hak cipta untuk dunia. Untuk mendapatkan informasi hak cipta default untuk seluruh dunia, jangan tentukan petak peta atau kotak pembatas.

Copyrights API dirancang untuk menyajikan informasi hak cipta untuk layanan Render. Selain hak cipta dasar untuk seluruh peta, API melayani grup hak cipta tertentu untuk beberapa negara/wilayah.

RenderGetCopyrightForWorldDefaultResponse

Mengembalikan informasi hak cipta untuk dunia. Untuk mendapatkan informasi hak cipta default untuk seluruh dunia, jangan tentukan petak peta atau kotak pembatas.

Copyrights API dirancang untuk menyajikan informasi hak cipta untuk layanan Render. Selain hak cipta dasar untuk seluruh peta, API melayani grup hak cipta tertentu untuk beberapa negara/wilayah.

RenderGetCopyrightForWorldQueryParam
RenderGetCopyrightForWorldQueryParamProperties
RenderGetCopyrightFromBoundingBox200Response

Mengembalikan informasi hak cipta untuk kotak pembatas tertentu. Permintaan kotak batas harus menentukan koordinat garis bujur dan lintang minimum dan maksimum (EPSG-3857)

RenderGetCopyrightFromBoundingBoxDefaultResponse

Mengembalikan informasi hak cipta untuk kotak pembatas tertentu. Permintaan kotak batas harus menentukan koordinat garis bujur dan lintang minimum dan maksimum (EPSG-3857)

RenderGetCopyrightFromBoundingBoxQueryParam
RenderGetCopyrightFromBoundingBoxQueryParamProperties
RenderGetMapAttribution200Response

API Get Map Attribution memungkinkan pengguna untuk meminta informasi atribusi hak cipta peta untuk bagian tileset.

RenderGetMapAttributionDefaultResponse

API Get Map Attribution memungkinkan pengguna untuk meminta informasi atribusi hak cipta peta untuk bagian tileset.

RenderGetMapAttributionQueryParam
RenderGetMapAttributionQueryParamProperties
RenderGetMapStateTile200Headers
RenderGetMapStateTile200Response

Mengambil petak peta status dalam format vektor biasanya untuk diintegrasikan ke dalam modul peta dalam ruangan kontrol peta atau SDK. Kontrol peta akan memanggil API ini setelah pengguna mengaktifkan gaya dinamis. Untuk informasi selengkapnya, lihat Tingkat Zoom dan Kisi Petak peta.

RenderGetMapStateTileDefaultResponse

Mengambil petak peta status dalam format vektor biasanya untuk diintegrasikan ke dalam modul peta dalam ruangan kontrol peta atau SDK. Kontrol peta akan memanggil API ini setelah pengguna mengaktifkan gaya dinamis. Untuk informasi selengkapnya, lihat Tingkat Zoom dan Kisi Petak peta.

RenderGetMapStateTileQueryParam
RenderGetMapStateTileQueryParamProperties
RenderGetMapStaticImage200Headers
RenderGetMapStaticImage200Response

API penyajian ini menghasilkan tampilan peta statis dan raster dari area yang ditentukan pengguna. Ini cocok untuk aplikasi web yang ringan, ketika pengalaman pengguna yang diinginkan tidak memerlukan kontrol peta interaktif, atau ketika bandwidth terbatas. API ini juga berguna untuk menyematkan peta dalam aplikasi di luar browser, di layanan backend, pembuatan laporan, atau aplikasi desktop.

API ini mencakup parameter untuk visualisasi data dasar:

  • Berlabel pushpin dalam beberapa gaya.
  • Jenis geometri lingkaran, jalur, dan poligon render.

Untuk informasi selengkapnya dan contoh terperinci, lihat Merender data kustom pada peta raster.

Dimensi parameter bbox dibatasi, tergantung pada tingkat pembesaran tampilan. Ini memastikan gambar yang dihasilkan memiliki tingkat detail yang sesuai.

Tingkat Perbesar Tampilan Rentang Lon Min Rentang Maks Lon Rentang Laju Min Rentang Lalat Maks
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

Catatan: Parameter pusat atau bbox harus disediakan ke API.

RenderGetMapStaticImageDefaultResponse

API penyajian ini menghasilkan tampilan peta statis dan raster dari area yang ditentukan pengguna. Ini cocok untuk aplikasi web yang ringan, ketika pengalaman pengguna yang diinginkan tidak memerlukan kontrol peta interaktif, atau ketika bandwidth terbatas. API ini juga berguna untuk menyematkan peta dalam aplikasi di luar browser, di layanan backend, pembuatan laporan, atau aplikasi desktop.

API ini mencakup parameter untuk visualisasi data dasar:

  • Berlabel pushpin dalam beberapa gaya.
  • Jenis geometri lingkaran, jalur, dan poligon render.

Untuk informasi selengkapnya dan contoh terperinci, lihat Merender data kustom pada peta raster.

Dimensi parameter bbox dibatasi, tergantung pada tingkat pembesaran tampilan. Ini memastikan gambar yang dihasilkan memiliki tingkat detail yang sesuai.

Tingkat Perbesar Tampilan Rentang Lon Min Rentang Maks Lon Rentang Laju Min Rentang Lalat Maks
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

Catatan: Parameter pusat atau bbox harus disediakan ke API.

RenderGetMapStaticImageQueryParam
RenderGetMapStaticImageQueryParamProperties
RenderGetMapTile200Headers
RenderGetMapTile200Response

API Get Map Tiles dalam permintaan HTTP GET yang memungkinkan pengguna untuk meminta petak peta dalam format vektor atau raster biasanya diintegrasikan ke dalam kontrol peta atau SDK. Beberapa contoh petak peta yang dapat diminta adalah petak peta jalan Azure Maps, petak peta Radar Cuaca real time atau petak peta yang dibuat menggunakan Azure Maps Creator. Secara default, Azure Maps menggunakan petak peta vektor untuk kontrol peta webnya (Web SDK) dan Android SDK.

RenderGetMapTileDefaultResponse

API Get Map Tiles dalam permintaan HTTP GET yang memungkinkan pengguna untuk meminta petak peta dalam format vektor atau raster biasanya diintegrasikan ke dalam kontrol peta atau SDK. Beberapa contoh petak peta yang dapat diminta adalah petak peta jalan Azure Maps, petak peta Radar Cuaca real time atau petak peta yang dibuat menggunakan Azure Maps Creator. Secara default, Azure Maps menggunakan petak peta vektor untuk kontrol peta webnya (Web SDK) dan Android SDK.

RenderGetMapTileQueryParam
RenderGetMapTileQueryParamProperties
RenderGetMapTileset200Response

Get Map Tileset API memungkinkan pengguna untuk meminta metadata untuk tileset.

RenderGetMapTilesetDefaultResponse

Get Map Tileset API memungkinkan pengguna untuk meminta metadata untuk tileset.

RenderGetMapTilesetQueryParam
RenderGetMapTilesetQueryParamProperties
Routes

Alias Jenis

MapsRenderClient
RenderGetCopyrightCaptionParameters
RenderGetCopyrightForTileParameters
RenderGetCopyrightForWorldParameters
RenderGetCopyrightFromBoundingBoxParameters
RenderGetMapAttributionParameters
RenderGetMapStateTileParameters
RenderGetMapStaticImageParameters
RenderGetMapTileParameters
RenderGetMapTilesetParameters

Fungsi

createPathQuery((PolygonalPath | CircularPath)[])

Buat string kueri jalur untuk mendapatkan gambar statis peta permintaan.

Contoh

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

Membuat string kueri pin untuk mendapatkan gambar statis peta

Contoh

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)

Membuat instans MapsRenderClient dari kunci langganan.

Contoh

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)

Membuat instans MapsRender dari Azure Identity TokenCredential.

Contoh

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)

Membuat instans MapsRender dari Azure Identity AzureSASCredential.

Contoh

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")

Menghitung koordinat petak peta XY yang termasuk dalam koordinat untuk tingkat pembesaran tampilan tertentu. Referensi: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code

Contoh

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"));

Detail Fungsi

createPathQuery((PolygonalPath | CircularPath)[])

Buat string kueri jalur untuk mendapatkan gambar statis peta permintaan.

Contoh

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

Parameter

paths

(PolygonalPath | CircularPath)[]

Kumpulan PolygonalPath dan CircularPath yang ingin Anda gambarkan pada gambar.

Mengembalikan

string

createPinsQuery(PinSet[])

Membuat string kueri pin untuk mendapatkan gambar statis peta

Contoh

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

Parameter

pinSets

PinSet[]

Mengembalikan

string

  • String kueri yang terdiri.

default(AzureKeyCredential, ClientOptions)

Membuat instans MapsRenderClient dari kunci langganan.

Contoh

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

Parameter

credential
AzureKeyCredential

Instans AzureKeyCredential yang digunakan untuk mengautentikasi permintaan ke layanan

options
ClientOptions

Opsi yang digunakan untuk mengonfigurasi Klien Render

Mengembalikan

default(TokenCredential, string, ClientOptions)

Membuat instans MapsRender dari Azure Identity TokenCredential.

Contoh

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

Parameter

credential
TokenCredential

Instans TokenCredential yang digunakan untuk mengautentikasi permintaan ke layanan

mapsAccountClientId

string

Id klien Azure Maps dari sumber daya peta tertentu

options
ClientOptions

Opsi yang digunakan untuk mengonfigurasi Klien Render

Mengembalikan

default(AzureSASCredential, ClientOptions)

Membuat instans MapsRender dari Azure Identity AzureSASCredential.

Contoh

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

Parameter

credential
AzureSASCredential

Instans AzureSASCredential yang digunakan untuk mengautentikasi permintaan ke layanan

options
ClientOptions

Opsi yang digunakan untuk mengonfigurasi Klien Render

Mengembalikan

isUnexpected(RenderGetMapTile200Response | RenderGetMapTileDefaultResponse)

function isUnexpected(response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse): response

Parameter

Mengembalikan

response

isUnexpected(RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse)

function isUnexpected(response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse): response

Parameter

Mengembalikan

response

isUnexpected(RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse)

function isUnexpected(response: RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse): response

Parameter

Mengembalikan

response

isUnexpected(RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse)

function isUnexpected(response: RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse): response

Parameter

Mengembalikan

response

isUnexpected(RenderGetCopyrightCaption200Response | RenderGetCopyrightCaptionDefaultResponse)

function isUnexpected(response: RenderGetCopyrightCaption200Response | RenderGetCopyrightCaptionDefaultResponse): response

Parameter

Mengembalikan

response

isUnexpected(RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse)

function isUnexpected(response: RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse): response

Parameter

Mengembalikan

response

isUnexpected(RenderGetCopyrightFromBoundingBox200Response | RenderGetCopyrightFromBoundingBoxDefaultResponse)

function isUnexpected(response: RenderGetCopyrightFromBoundingBox200Response | RenderGetCopyrightFromBoundingBoxDefaultResponse): response

Parameter

Mengembalikan

response

isUnexpected(RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse)

function isUnexpected(response: RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse): response

Parameter

Mengembalikan

response

isUnexpected(RenderGetCopyrightForWorld200Response | RenderGetCopyrightForWorldDefaultResponse)

function isUnexpected(response: RenderGetCopyrightForWorld200Response | RenderGetCopyrightForWorldDefaultResponse): response

Parameter

Mengembalikan

response

positionToTileXY(LatLon, number, "256" | "512")

Menghitung koordinat petak peta XY yang termasuk dalam koordinat untuk tingkat pembesaran tampilan tertentu. Referensi: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code

Contoh

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 }

Parameter

position
LatLon

Koordinat posisi dalam format [garis lintang, bujur].

zoom

number

Tingkat perbesar tampilan.

tileSize

"256" | "512"

Ukuran petak peta dalam piramida petak peta.

Mengembalikan

{ x: number, y: number }

Petak koordinat XY.