service module

Azure Maps Web SDK Service Module service retirement. The Azure Maps Web SDK Service Module is now deprecated and will be retired on 9/30/26. To avoid service disruptions, we recommend migrating to use Azure Maps JavaScript REST SDK by 9/30/26. Please follow our instructions to migrate to Azure Maps JavaScript REST SDK.

Classes

Aborter

An aborter instance implements AbortSignal interface, can abort HTTP requests.

  • Call Aborter.none to create a new Aborter instance without timeout.
  • Call Aborter.timeout() to create a new Aborter instance with timeout.

For an existing instance aborter:

  • Call aborter.withTimeout() to create and return a child Aborter instance with timeout.
  • Call aborter.withValue(key, value) to create and return a child Aborter instance with key/value pair.
  • Call aborter.abort() to abort current instance and all children instances.
  • Call aborter.getValue(key) to search and get value with corresponding key from current aborter to all parents.
CarShareGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

ClosestPointGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

Credential

Credential is an abstract class for Azure Maps HTTP requests signing. This class will host an credentialPolicyCreator factory which generates CredentialPolicy.

CredentialPolicy

Credential policy used to sign HTTP(S) requests before sending. This is an abstract class.

GeofenceGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

LoggingPolicyFactory

LoggingPolicyFactory is a factory class helping generating LoggingPolicy objects.

MapControlCredential

MapControlCredential for sharing authentication with an atlas.Map instance.

MapControlCredentialPolicy

MapControlCredentialPolicy is a policy used to sign HTTP requests with shared authentication from an atlas.Map instance.

MapsURL

A MapsURL represents a base URL class for SearchURL, RouteURL and etc.

MetroAreaGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

NearbyTransitGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

Pipeline

A Pipeline class containing HTTP request policies. You can create a default Pipeline by calling MapsURL.newPipeline(). Or you can create a Pipeline with your own policies by the constructor of Pipeline. Refer to MapsURL.newPipeline() and provided policies as reference before implementing your customized Pipeline.

PointInPolygonGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

RealTimeArrivalsGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

RenderURL

A RenderURL represents a URL to the Azure Maps render operations.

RetryPolicyFactory

RetryPolicyFactory is a factory class helping generating RetryPolicy objects.

RouteGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

RouteRangeGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

RouteURL

A RouteURL represents a URL to the Azure Maps route operations.

SasCredential

SasCredential is a Credential used to generate a SasCredentialPolicy. Renew token by setting a new token string value to token property.

Example

const sasCredential = new SasCredential("token"); const pipeline = MapsURL.newPipeline(sasCredential);

const searchURL = new SearchURL(pipeline);

// Set up a timer to refresh the token const timerID = setInterval(() => { // Update token by accessing to public sasCredential.token sasCredential.token = "updatedToken"; // WARNING: Timer must be manually stopped! It will forbid GC of sasCredential if (shouldStop()) { clearInterval(timerID); } }, 60 * 60 * 1000); // Set an interval time before your token expired

SasCredentialPolicy

SasCredentialPolicy is a policy used to sign HTTP request with a token. Such as an JWT SAS token.

SearchGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

SearchPolygonGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

SearchReverseGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

SearchURL

A SearchURL represents a URL to the Azure Maps search operations.

SpatialURL

A SpatialURL represents a URL to the Azure Maps spatial operations.

SubscriptionKeyCredential

SubscriptionKeyCredential for account key authorization of Azure Maps service.

SubscriptionKeyCredentialPolicy

SubscriptionKeyCredentialPolicy is a policy used to sign HTTP requests with a subscription key.

TimezoneURL

A TimezoneURL represents a URL to the Azure Maps timezone operations.

TokenCredential

TokenCredential is a Credential used to generate a TokenCredentialPolicy. Renew token by setting a new token string value to token property.

Example

const tokenCredential = new TokenCredential("clientId", "token"); const pipeline = MapsURL.newPipeline(tokenCredential);

const searchURL = new SearchURL(pipeline);

// Set up a timer to refresh the token const timerID = setInterval(() => { // Update token by accessing to public tokenCredential.token tokenCredential.token = "updatedToken"; // WARNING: Timer must be manually stopped! It will forbid GC of tokenCredential if (shouldStop()) { clearInterval(timerID); } }, 60 * 60 * 1000); // Set an interval time before your token expired

TokenCredentialPolicy

TokenCredentialPolicy is a policy used to sign HTTP request with a token. Such as an OAuth bearer token.

TransitDockGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

TransitItineraryGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

TransitLineGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

TransitStopGeojson

A helper extension providing methods for accessing the response data in GeoJSON format.

Interfaces

IBaseGeojson

The base interface for a geojson helper extension.

INewPipelineOptions

Option interface for MapsURL.newPipeline method.

IPipelineOptions

Option interface for Pipeline constructor.

IRequestLogOptions

IRequestLogOptions configures the retry policy's behavior.

IRetryOptions

Retry options interface.

Type Aliases

BaseRequestPolicy
CalculateRouteDirectionsOptions
CalculateRouteDirectionsResponse
CalculateRouteMatrixOptions
CalculateRouteMatrixRequestBody
CalculateRouteMatrixResponse
CalculateRouteRangeOptions
CalculateRouteRangeResponse
CredentialPolicyCreator

A factory function that creates a new CredentialPolicy that uses the provided nextPolicy.

GetBufferResponse
GetCarShareInfoOptions
GetCarShareInfoResponse
GetClosesPointResponse
GetClosestPointOptions
GetGeofenceOptions
GetGeofenceResponse
GetGreatCircleDistance
GetMapImageOptions
GetMapImageResponse
GetMapImageryTileResponse
GetMapTileOptions
GetMapTileResponse
GetMetroAreaInfoOptions
GetMetroAreaInfoResponse
GetMetroAreaOptions
GetMetroAreaResponse
GetNearbyTransitOptions
GetNearbyTransitResponse
GetPointInPolygonResponse
GetRealTimeArrivalsOptions
GetRealTimeArrivalsResponse
GetTimezoneByCoordinatesOptions
GetTimezoneByCoordinatesResponse
GetTimezoneByIdOptions
GetTimezoneByIdResponse
GetTransitDockInfoOptions
GetTransitDockInfoResponse
GetTransitItineraryOptions
GetTransitItineraryResponse
GetTransitLineInfoOptions
GetTransitLineInfoResponse
GetTransitRouteOptions
GetTransitRouteResponse
GetTransitStopInfoOptions
GetTransitStopInfoResponse
HttpHeaders
HttpOperationResponse
HttpPipelineLogLevel
IHttpClient
IHttpPipelineLogger
Merge
RequestPolicy
RequestPolicyFactory
RequestPolicyOptions
Response

A type alias for easily representing a response interface with or without a geojson helper. Also provides the raw response data in the response object.

RestError
SearchAddressOptions
SearchAddressResponse
SearchAddressReverseCrossStreetOptions
SearchAddressReverseCrossStreetResponse
SearchAddressReverseOptions
SearchAddressReverseResponse
SearchAddressStructuredOptions
SearchAddressStructuredResponse
SearchAlongRouteOptions
SearchAlongRouteRequestBody
SearchAlongRouteResponse
SearchFuzzyOptions
SearchFuzzyResponse
SearchInsideGeometryOptions
SearchInsideGeometryRequestBody
SearchInsideGeometryResponse
SearchNearbyOptions
SearchNearbyResponse
SearchPOICategoryOptions
SearchPOICategoryResponse
SearchPOIOptions
SearchPOIResponse
SearchPolygonResponse
SpatialFeatureCollection

A GeoJSON FeatureCollection whose features each specify a geometryId in their properties.

UndefinedGeojson
WebResource

Enums

RetryPolicyType

RetryPolicy types.

Functions

deserializationPolicy()

Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they pass through the HTTP pipeline.

Function Details

deserializationPolicy()

Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they pass through the HTTP pipeline.

function deserializationPolicy(): RequestPolicyFactory

Returns