MobilityURL class

A MobilityURL represents a URL to the Azure Maps mobility operations.

Extends

Constructors

MobilityURL(Pipeline, string)

Creates an instance of MobilityURL.

Properties

mapsUrl

Base URL string value.

Methods

getCarShareInfo(Aborter, string, GetCarShareInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Requests static and real-time information for a given car share vehicle. Response contains details such as availability and vacancy information and operator details. The service supplements Nearby Transit API. Uses the Get Car Share Info API: https://docs.microsoft.com/rest/api/maps/mobility/getcarshareinfopreview

getMetroArea(Aborter, GeoJSON, GetMetroAreaOptions)

Note: This API is currently in preview and may be subject to breaking changes. Request metro areas in which the Azure Maps Mobility Service is available. The service supports filtering results by country or coordinate location. Information returned includes Metro Area details such as metro Id, name and a representation of the metro area geometry in GeoJSON format. Uses the Get Metro Area API: https://docs.microsoft.com/rest/api/maps/mobility/getmetroareapreview

getMetroAreaInfo(Aborter, number, MetroAreaDetailType[], GetMetroAreaInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Request additional information for metro areas in which the Azure Maps Mobility Service is available. Information such as supported transit types, transit agencies and active alerts is available, depending on the options selected. Uses the Get Metro Area Info API: https://docs.microsoft.com/rest/api/maps/mobility/getmetroareainfopreview

getNearbyTransit(Aborter, number, GeoJSON.Position, GetNearbyTransitOptions)

Note: This API is currently in preview and may be subject to breaking changes. Searches transit objects, for example, public transit stops ans shared bikes around a given location returning the transit object details. Service allows users to search for specific object types and within a given radius returning a set of transit object with object details. Additional information such as transit operator information is returned depending on the options selected. The returned information can be used for further processing such as requesting real-time arrivals for the stop or transit stop details such as main transit type of most lines stopping for a given public, active service alerts or main transport agency. Uses the Get Nearby Transit API: https://docs.microsoft.com/rest/api/maps/mobility/getnearbytransitpreview

getRealTimeArrivals(Aborter, number, string | string[] | GeoJSON.Position, GetRealTimeArrivalsOptions)

Note: This API is currently in preview and may be subject to breaking changes. Returns for a given a stop, line or location the requested number of real-time arrivals. Endpoint support different modes to request real-time arrivals such as number of live arrivals for all lines arriving at the specified stop or all arrivals of a line to stops near the user’s location. The API supports parameters to request one or multiple public transit types such as bus, tram and subway, maximum number if arrivals, and prefer a specific transit agency operating in the area. In some cases real-time arrivals may not be available, for example, if arrival is too far in the future or transit vehicle does not have capability to share the real-time location. This is symbolized in a scheduleType field present in all responses. Uses Get Real Time Arrivals API: https://docs.microsoft.com/rest/api/maps/mobility/getrealtimearrivalspreview

getTransitDockInfo(Aborter, string, GetTransitDockInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Request static and real-time information for a given bike or scooter docking station. Response includes availability and vacancy information and operator details. The service supplements Nearby Transit API that allows you to search nearby bike and scooter docking stations. Uses the Get Transit Dock Info API: https://docs.microsoft.com/rest/api/maps/mobility/gettransitdockinfopreview

getTransitItinerary(Aborter, string, GetTransitItineraryOptions)

Note: This API is currently in preview and may be subject to breaking changes. Returns data according to an itinerary Id previously returned by Transit Route API. The basic info contains data as to the various legs comprising the itinerary, including the locations, public transit lines, start and end times. User can request additional routing information such as the shape of the itinerary and detailed itinerary schedules is also available, depending on the options selected. An itinerary is available up to 24 hours following a search request. Uses the Get Transit Itinerary API: https://docs.microsoft.com/rest/api/maps/mobility/gettransititinerarypreview

getTransitLineInfo(Aborter, number, string, GetTransitLineInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Request line group by line group id returning a line group comprised a set of lines. Additional information such as 24 hours static schedule, active alerts for the line group and line patterns is also available, depending on the options selected. Mobility services uses a parallel data model for public transit lines and line groups. Usually line group contains 2 lines, one going from A to B, and the other returning from B to A, both operating by the same Public Transport Agency having the same line number. We recommend you review our guidance article to understand the concepts of lines and line groups. Uses the Get Transit Line Info API: https://docs.microsoft.com/rest/api/maps/mobility/gettransitlineinfopreview

getTransitRoute(Aborter, number, string | GeoJSON.Position, string | GeoJSON.Position, GetTransitRouteOptions)

Note: This API is currently in preview and may be subject to breaking changes. Allow trip planning returning the best possible route options between an origin and destination by using multi-modal search. Service provides a variety of travel modes, including walk, bike, and public transit. The API supports parameters to request one or multiple public transit types such as bus, tram and subway, and focus on certain types of bikes, and prefer a specific transit agency operating in the area. Also, service provides options to choose optimal route with least walk or transfers and specify arrival or departure times when user need to be at a specific destination by a certain time. Uses the Get Transit Route API: https://docs.microsoft.com/rest/api/maps/mobility/gettransitroutepreview

getTransitStopInfo(Aborter, number, string, GetTransitStopInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Requests information for a given public transit stop. Basic information returned includes details such as main transit type of most lines stopping for a given public and main transport agency. Additional details such as stop lines, active service alerts for specified stop, photos and user reviews are also available, depending on the options selected. Uses the Get Transit Stop Info API: https://docs.microsoft.com/rest/api/maps/mobility/gettransitstopinfopreview

newPipeline(Credential, INewPipelineOptions)

A static method used to create a new Pipeline object with Credential provided.

Constructor Details

MobilityURL(Pipeline, string)

Creates an instance of MobilityURL.

new MobilityURL(pipeline: Pipeline, mapsUrl?: string)

Parameters

pipeline
Pipeline

Call MapsURL.newPipeline() to create a default pipeline, or provide a customized pipeline.

mapsUrl

string

A URL string pointing to Azure Maps service, default is "https://atlas.microsoft.com". If no protocol is specified, e.g. "atlas.microsoft.com", then https will be assumed.

Property Details

mapsUrl

Base URL string value.

mapsUrl: string

Property Value

string

Method Details

getCarShareInfo(Aborter, string, GetCarShareInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Requests static and real-time information for a given car share vehicle. Response contains details such as availability and vacancy information and operator details. The service supplements Nearby Transit API. Uses the Get Car Share Info API: https://docs.microsoft.com/rest/api/maps/mobility/getcarshareinfopreview

function getCarShareInfo(aborter: Aborter, query: string, options?: GetCarShareInfoOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

query

string

vehicleId. The unique identifier of the car share vehicle. For example, "29B8C4AFC062D681E050007F01004F07". Can be requested by using Nearby Transit API.

Returns

getMetroArea(Aborter, GeoJSON, GetMetroAreaOptions)

Note: This API is currently in preview and may be subject to breaking changes. Request metro areas in which the Azure Maps Mobility Service is available. The service supports filtering results by country or coordinate location. Information returned includes Metro Area details such as metro Id, name and a representation of the metro area geometry in GeoJSON format. Uses the Get Metro Area API: https://docs.microsoft.com/rest/api/maps/mobility/getmetroareapreview

function getMetroArea(aborter: Aborter, query: GeoJSON, options?: GetMetroAreaOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

query

GeoJSON

The applicable location input. Can be a GeoJSON position or countryCode (2-character ISO country code).

Returns

getMetroAreaInfo(Aborter, number, MetroAreaDetailType[], GetMetroAreaInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Request additional information for metro areas in which the Azure Maps Mobility Service is available. Information such as supported transit types, transit agencies and active alerts is available, depending on the options selected. Uses the Get Metro Area Info API: https://docs.microsoft.com/rest/api/maps/mobility/getmetroareainfopreview

function getMetroAreaInfo(aborter: Aborter, query: number, detailType: MetroAreaDetailType[], options?: GetMetroAreaInfoOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

query

number

metroId. The unique id of the metro area. Required parameter specifying the required metro area to search in. Can be retrieved via Get Metro Area API.

detailType

MetroAreaDetailType[]

Specify details requested respective to the metro area as a comma separated list.

Returns

getNearbyTransit(Aborter, number, GeoJSON.Position, GetNearbyTransitOptions)

Note: This API is currently in preview and may be subject to breaking changes. Searches transit objects, for example, public transit stops ans shared bikes around a given location returning the transit object details. Service allows users to search for specific object types and within a given radius returning a set of transit object with object details. Additional information such as transit operator information is returned depending on the options selected. The returned information can be used for further processing such as requesting real-time arrivals for the stop or transit stop details such as main transit type of most lines stopping for a given public, active service alerts or main transport agency. Uses the Get Nearby Transit API: https://docs.microsoft.com/rest/api/maps/mobility/getnearbytransitpreview

function getNearbyTransit(aborter: Aborter, metroId: number, location: GeoJSON.Position, options?: GetNearbyTransitOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

metroId

number

The unique id of the metro area. Required parameter specifying the required metro area to search in. Can be retrieved via Get Metro Area API.

location
GeoJSON.Position

Location input from user.

Returns

getRealTimeArrivals(Aborter, number, string | string[] | GeoJSON.Position, GetRealTimeArrivalsOptions)

Note: This API is currently in preview and may be subject to breaking changes. Returns for a given a stop, line or location the requested number of real-time arrivals. Endpoint support different modes to request real-time arrivals such as number of live arrivals for all lines arriving at the specified stop or all arrivals of a line to stops near the user’s location. The API supports parameters to request one or multiple public transit types such as bus, tram and subway, maximum number if arrivals, and prefer a specific transit agency operating in the area. In some cases real-time arrivals may not be available, for example, if arrival is too far in the future or transit vehicle does not have capability to share the real-time location. This is symbolized in a scheduleType field present in all responses. Uses Get Real Time Arrivals API: https://docs.microsoft.com/rest/api/maps/mobility/getrealtimearrivalspreview

function getRealTimeArrivals(aborter: Aborter, metroId: number, query: string | string[] | GeoJSON.Position, options?: GetRealTimeArrivalsOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

metroId

number

The unique id of the metro area. Required parameter specifying the required metro area to search in. Can be retrieved via Get Metro Area API.

query

string | string[] | GeoJSON.Position

Stop, line or location identifier. For stop queries a string or string[] of stop IDs can be provided. For line queries a string of the line ID can be provided. For line and stop queries a string[] of ["lineId", "stopId"] can be provided. For position queries a GeoJSON.Position can be provided.

Returns

getTransitDockInfo(Aborter, string, GetTransitDockInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Request static and real-time information for a given bike or scooter docking station. Response includes availability and vacancy information and operator details. The service supplements Nearby Transit API that allows you to search nearby bike and scooter docking stations. Uses the Get Transit Dock Info API: https://docs.microsoft.com/rest/api/maps/mobility/gettransitdockinfopreview

function getTransitDockInfo(aborter: Aborter, query: string, options?: GetTransitDockInfoOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

query

string

dockId. Required parameter specifying the docking station to search for. Can be retrieved via Get Nearby Transit API.

Returns

getTransitItinerary(Aborter, string, GetTransitItineraryOptions)

Note: This API is currently in preview and may be subject to breaking changes. Returns data according to an itinerary Id previously returned by Transit Route API. The basic info contains data as to the various legs comprising the itinerary, including the locations, public transit lines, start and end times. User can request additional routing information such as the shape of the itinerary and detailed itinerary schedules is also available, depending on the options selected. An itinerary is available up to 24 hours following a search request. Uses the Get Transit Itinerary API: https://docs.microsoft.com/rest/api/maps/mobility/gettransititinerarypreview

function getTransitItinerary(aborter: Aborter, query: string, options?: GetTransitItineraryOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

query

string

The unique id (itineraryId) of an itinerary previously returned by Transit Route API.

Returns

getTransitLineInfo(Aborter, number, string, GetTransitLineInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Request line group by line group id returning a line group comprised a set of lines. Additional information such as 24 hours static schedule, active alerts for the line group and line patterns is also available, depending on the options selected. Mobility services uses a parallel data model for public transit lines and line groups. Usually line group contains 2 lines, one going from A to B, and the other returning from B to A, both operating by the same Public Transport Agency having the same line number. We recommend you review our guidance article to understand the concepts of lines and line groups. Uses the Get Transit Line Info API: https://docs.microsoft.com/rest/api/maps/mobility/gettransitlineinfopreview

function getTransitLineInfo(aborter: Aborter, metroId: number, query: string, options?: GetTransitLineInfoOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

metroId

number

The unique id of the metro area. Required parameter specifying the required metro area to search in. Can be retrieved via Get Metro Area API.

query

string

lineGroupId, for example,'666074'. Typically contains 2 lines having the same agency and line, one going from A to B, and the other from B to A.

Returns

getTransitRoute(Aborter, number, string | GeoJSON.Position, string | GeoJSON.Position, GetTransitRouteOptions)

Note: This API is currently in preview and may be subject to breaking changes. Allow trip planning returning the best possible route options between an origin and destination by using multi-modal search. Service provides a variety of travel modes, including walk, bike, and public transit. The API supports parameters to request one or multiple public transit types such as bus, tram and subway, and focus on certain types of bikes, and prefer a specific transit agency operating in the area. Also, service provides options to choose optimal route with least walk or transfers and specify arrival or departure times when user need to be at a specific destination by a certain time. Uses the Get Transit Route API: https://docs.microsoft.com/rest/api/maps/mobility/gettransitroutepreview

function getTransitRoute(aborter: Aborter, metroId: number, origin: string | GeoJSON.Position, destination: string | GeoJSON.Position, options?: GetTransitRouteOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

metroId

number

The unique id of the metro area. Required parameter specifying the required metro area to search in. Can be retrieved via Get Metro Area API.

origin

string | GeoJSON.Position

The origin of the route. If originType=position a GeoJSON.Position should be specified. Otherwise, a string should be specified.

destination

string | GeoJSON.Position

The destination of the route. If destinationType=position a GeoJSON.Position should be specified. Otherwise, a string should be specified.

Returns

getTransitStopInfo(Aborter, number, string, GetTransitStopInfoOptions)

Note: This API is currently in preview and may be subject to breaking changes. Requests information for a given public transit stop. Basic information returned includes details such as main transit type of most lines stopping for a given public and main transport agency. Additional details such as stop lines, active service alerts for specified stop, photos and user reviews are also available, depending on the options selected. Uses the Get Transit Stop Info API: https://docs.microsoft.com/rest/api/maps/mobility/gettransitstopinfopreview

function getTransitStopInfo(aborter: Aborter, metroId: number, query: string, options?: GetTransitStopInfoOptions)

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation.

metroId

number

The unique id of the metro area. Required parameter specifying the required metro area to search in. Can be retrieved via Get Metro Area API.

query

string

The stopId or stopKey for which the user is requesting transit stop details.

Returns

newPipeline(Credential, INewPipelineOptions)

A static method used to create a new Pipeline object with Credential provided.

static function newPipeline(credential: Credential, pipelineOptions?: INewPipelineOptions)

Parameters

credential
Credential

Such as SubscriptionKeyCredential, TokenCredential, and MapControlCredential.

pipelineOptions
INewPipelineOptions

Returns

A new Pipeline object.