@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 Sebagai alternatif untuk hak cipta untuk permintaan peta, ia juga dapat mengembalikan keterangan untuk menampilkan informasi penyedia di peta. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightCaptionDefaultResponse |
API 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 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapAttributionDefaultResponse |
API |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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:
Untuk informasi selengkapnya dan contoh terperinci, lihat Merender data kustom pada peta raster.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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:
Untuk informasi selengkapnya dan contoh terperinci, lihat Merender data kustom pada peta raster.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTile200Headers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTile200Response |
API |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileDefaultResponse |
API |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
Fungsi
| create |
Buat string kueri jalur untuk mendapatkan gambar statis peta permintaan. Contoh
|
| create |
Membuat string kueri pin untuk mendapatkan gambar statis peta Contoh
|
| default(Azure |
Membuat instans MapsRenderClient dari kunci langganan. Contoh
|
| default(Token |
Membuat instans MapsRender dari Azure Identity Contoh
|
| default(Azure |
Membuat instans MapsRender dari Azure Identity Contoh
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| position |
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
|
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
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.