@azure-rest/maps-render package
Interfaces
| CircularPath |
Specify a circular path. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CircularPathOptions |
The options that modify the style of a circular path. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CopyrightCaptionOutput |
This object is returned from a successful copyright call |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CopyrightOutput |
This object is returned from a successful copyright request |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ErrorAdditionalInfoOutput |
The resource management error additional info. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ErrorDetailOutput |
The error detail. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ErrorResponseOutput |
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetCopyrightCaption | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetCopyrightForTile | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetCopyrightForWorld | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetCopyrightFromBoundingBox | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapAttribution | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapStateTile | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapStaticImage | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapTile | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetMapTileset | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MapAttributionOutput |
Copyright attribution for the requested section of a tileset. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MapTilesetOutput |
Metadata for a tileset in the TileJSON format. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MapsRenderClientOptions |
The optional parameters for the client |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pin |
Specify how the pin's position and label text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PinOptions |
The pin options for default/none image style.. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PinSet | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PolygonalPath |
Specify a polygonal path. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PolygonalPathOptions |
The options that modify the style of a polygonal path. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RegionCopyrightsCountryOutput |
Country property |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RegionCopyrightsOutput | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightCaption200Response |
The As an alternative to copyrights for map request, it can also return captions for displaying provider information on the map. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightCaptionDefaultResponse |
The As an alternative to copyrights for map request, it can also return captions for displaying provider information on the map. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTile200Response |
To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates. For more information, see Zoom Levels and Tile Grid. Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTileDefaultResponse |
To obtain the copyright information for a particular tile, the request should specify the tile's zoom level and x and y coordinates. For more information, see Zoom Levels and Tile Grid. Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTileQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForTileQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorld200Response |
Returns the copyright information for the world. To obtain the default copyright information for the whole world, don't specify a tile or bounding box. Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorldDefaultResponse |
Returns the copyright information for the world. To obtain the default copyright information for the whole world, don't specify a tile or bounding box. Copyrights API is designed to serve copyright information for Render service. In addition to basic copyright for the whole map, API is serving specific groups of copyrights for some countries/regions. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorldQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightForWorldQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightFromBoundingBox200Response |
Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightFromBoundingBoxDefaultResponse |
Returns copyright information for a given bounding box. Bounding-box requests should specify the minimum and maximum longitude and latitude (EPSG-3857) coordinates |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightFromBoundingBoxQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetCopyrightFromBoundingBoxQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapAttribution200Response |
The |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapAttributionDefaultResponse |
The |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapAttributionQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapAttributionQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTile200Headers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTile200Response |
Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling. For more information, see Zoom Levels and Tile Grid. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTileDefaultResponse |
Fetches state tiles in vector format typically to be integrated into indoor maps module of map control or SDK. The map control will call this API after user turns on dynamic styling. For more information, see Zoom Levels and Tile Grid. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTileQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStateTileQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImage200Headers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImage200Response |
This rendering API produces static, rasterized map views of a user-defined area. It's suitable for lightweight web applications, when the desired user experience doesn't require interactive map controls, or when bandwidth is limited. This API is also useful for embedding maps in applications outside of the browser, in backend services, report generation, or desktop applications. This API includes parameters for basic data visualization:
For more information and detailed examples, see Render custom data on a raster map.
Note : Either center or bbox parameter must be supplied to the API. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageDefaultResponse |
This rendering API produces static, rasterized map views of a user-defined area. It's suitable for lightweight web applications, when the desired user experience doesn't require interactive map controls, or when bandwidth is limited. This API is also useful for embedding maps in applications outside of the browser, in backend services, report generation, or desktop applications. This API includes parameters for basic data visualization:
For more information and detailed examples, see Render custom data on a raster map.
Note : Either center or bbox parameter must be supplied to the API. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapStaticImageQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTile200Headers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTile200Response |
The |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileDefaultResponse |
The |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTileset200Response |
The Get Map Tileset API allows users to request metadata for a tileset. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTilesetDefaultResponse |
The Get Map Tileset API allows users to request metadata for a tileset. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTilesetQueryParam | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RenderGetMapTilesetQueryParamProperties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Routes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type Aliases
Functions
| create |
Create a path query string for get map static image request. Example
|
| create |
Create a pin query string for get map static image Example
|
| default(Azure |
Creates an instance of MapsRenderClient from a subscription key. Example
|
| default(Token |
Creates an instance of MapsRender from an Azure Identity Example
|
| default(Azure |
Creates an instance of MapsRender from an Azure Identity Example
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| is |
|
| position |
Calculates the XY tile coordinates that a coordinate falls into for a specific zoom level. Reference: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code Example
|
Function Details
createPathQuery((PolygonalPath | CircularPath)[])
Create a path query string for get map static image request.
Example
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
Parameters
- paths
-
(PolygonalPath | CircularPath)[]
A collection of PolygonalPath and CircularPath that you want to draw on the image.
Returns
string
createPinsQuery(PinSet[])
Create a pin query string for get map static image
Example
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
Parameters
- pinSets
-
PinSet[]
Returns
string
- The composed query string.
default(AzureKeyCredential, ClientOptions)
Creates an instance of MapsRenderClient from a subscription key.
Example
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
Parameters
- credential
- AzureKeyCredential
An AzureKeyCredential instance used to authenticate requests to the service
- options
- ClientOptions
Options used to configure the Render Client
Returns
default(TokenCredential, string, ClientOptions)
Creates an instance of MapsRender from an Azure Identity TokenCredential.
Example
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
Parameters
- credential
- TokenCredential
An TokenCredential instance used to authenticate requests to the service
- mapsAccountClientId
-
string
The Azure Maps client id of a specific map resource
- options
- ClientOptions
Options used to configure the Render Client
Returns
default(AzureSASCredential, ClientOptions)
Creates an instance of MapsRender from an Azure Identity AzureSASCredential.
Example
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
Parameters
- credential
- AzureSASCredential
An AzureSASCredential instance used to authenticate requests to the service
- options
- ClientOptions
Options used to configure the Render Client
Returns
isUnexpected(RenderGetMapTile200Response | RenderGetMapTileDefaultResponse)
function isUnexpected(response: RenderGetMapTile200Response | RenderGetMapTileDefaultResponse): response
Parameters
Returns
response
isUnexpected(RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse)
function isUnexpected(response: RenderGetMapTileset200Response | RenderGetMapTilesetDefaultResponse): response
Parameters
Returns
response
isUnexpected(RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse)
function isUnexpected(response: RenderGetMapAttribution200Response | RenderGetMapAttributionDefaultResponse): response
Parameters
Returns
response
isUnexpected(RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse)
function isUnexpected(response: RenderGetMapStateTile200Response | RenderGetMapStateTileDefaultResponse): response
Parameters
Returns
response
isUnexpected(RenderGetCopyrightCaption200Response | RenderGetCopyrightCaptionDefaultResponse)
function isUnexpected(response: RenderGetCopyrightCaption200Response | RenderGetCopyrightCaptionDefaultResponse): response
Parameters
Returns
response
isUnexpected(RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse)
function isUnexpected(response: RenderGetMapStaticImage200Response | RenderGetMapStaticImageDefaultResponse): response
Parameters
Returns
response
isUnexpected(RenderGetCopyrightFromBoundingBox200Response | RenderGetCopyrightFromBoundingBoxDefaultResponse)
function isUnexpected(response: RenderGetCopyrightFromBoundingBox200Response | RenderGetCopyrightFromBoundingBoxDefaultResponse): response
Parameters
Returns
response
isUnexpected(RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse)
function isUnexpected(response: RenderGetCopyrightForTile200Response | RenderGetCopyrightForTileDefaultResponse): response
Parameters
Returns
response
isUnexpected(RenderGetCopyrightForWorld200Response | RenderGetCopyrightForWorldDefaultResponse)
function isUnexpected(response: RenderGetCopyrightForWorld200Response | RenderGetCopyrightForWorldDefaultResponse): response
Parameters
Returns
response
positionToTileXY(LatLon, number, "256" | "512")
Calculates the XY tile coordinates that a coordinate falls into for a specific zoom level. Reference: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code
Example
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 }
Parameters
- position
- LatLon
Position coordinate in the format [latitude, longitude].
- zoom
-
number
Zoom level.
- tileSize
-
"256" | "512"
The size of the tiles in the tile pyramid.
Returns
{ x: number, y: number }
Tile XY coordinates.