atlas module

Classes

EventManager

A manager for the map control's events. Exposed through the events property of the atlas.Map class. Cannot be instantiated by the user.

HtmlMarker

This class wraps an HTML element that can be displayed on the map.

Map

The control for a visual and interactive web map.

Pixel

Represent a pixel coordinate or offset. Extends an array of [x, y].

Popup

An information window anchored at a specified position on a map.

Shape

A helper class that wraps a Geometry or Feature and makes it easy to update and maintain.

Interfaces

AggregateExpression

An aggregate expression defines a calculation that is processed over a set of data. Schema: [operator: string, initialValue?: boolean | number, mapExpression: Expression] operator: An expression function that is then applied to against all values calculated by the mapExpression for each point in the cluster. Supported operators: o For numbers: +, *, max, min o For Booleans: all, any initialValue: Optional, an initial value in which the first calculated value is aggregated against. mapExpression: An expression that is applied against each point in the data set.

AnimationOptions

The options for animating changes to the map control's camera.

AuthenticationManager

A manager for the map control's authentication. Exposed through the authentication property of the atlas.Map class. Cannot be instantiated by the user.

AuthenticationOptions

Options for specifying how the map control should authenticate with the Azure Maps services.

BubbleLayerOptions

Options used when rendering Point objects in a BubbleLayer.

CameraBoundsOptions

The options for setting the bounds of the map control's camera.

CameraOptions

The options for setting the map control's camera.

ClusteredProperties

The properties which will exist for ClusteredProperties

CompassControlOptions

The options for a CompassControl object.

ControlManager

A manager for the map control's controls. Exposed through the controls property of the atlas.Map class. Cannot be instantiated by the user.

ControlOptions

The options for adding a control to the map.

DataSourceOptions

A data source for managing shape data that will be displayed on the map. A data source must be added to a layer before it is visible on the map. Options for a DataSourceOptions.

Expression

Can be specified as the value of filter or certain layer options. An expression defines a formula for computing the value of the property. Expressions are represented as JSON arrays. The first element of an expression is a string naming the expression operator.

FloorChangeEvent

For internal use only. Event object returned by the maps when the floor number changes.

FloorPickerControlOptions

For internal use only. The options for a FloorPickerControlOptions object.

HeatMapLayerOptions

Options used when rendering Point objects in a HeatMapLayer.

HtmlMarkerEvents
HtmlMarkerManager

A manager for the map control's HTML markers. Exposed through the markers property of the atlas.Map class. Cannot be instantiated by the user.

HtmlMarkerOptions

Options for rendering an HtmlMarker object

IconOptions

Options used to customize the icons in a SymbolLayer

ImageLayerOptions

Options used when rendering Point objects in a ImageLayer.

ImageSpriteManager

A manager for the map control's image sprite. Exposed through the imageSprite property of the atlas.Map class. Cannot be instantiated by the user.

LayerManager

A manager for the map control's layers. Exposed through the layers property of the atlas.Map class. Cannot be instantiated by the user.

LayerOptions

A base class which all other layer options inherit from.

LineLayerOptions

Options used when rendering SimpleLine, SimplePolygon, CirclePolygon, LineString, MultiLineString, Polygon, and MultiPolygon objects in a line layer.

MapErrorEvent

Event object returned by the maps when an error event occurs.

MapEvent

Event object returned by the maps when a basic event occurs.

MapMouseEvent

Event object returned by the maps when a mouse event occurs.

MapMouseWheelEvent

Event object returned by the maps when a wheel event occurs.

MapTouchEvent

Event object returned by the maps when a touch event occurs.

MediaLayerOptions

Options used when rendering canvas, image, raster tile, and video layers

Options
Padding

Represent the amount of padding in pixels to add to the side of a BoundingBox when setting the camera of a map.

PitchControlOptions

The options for a PitchControl object.

PolygonLayerOptions

Options used when rendering Polygon and MultiPolygon objects in a PolygonLayer.

PopupEvents
PopupOptions

The options for a popup.

RequestParameters

This is the object type expected to be returned by the transformRequest callback.

ServiceOptions

Global properties used in all atlas service requests.

ShapeEvents
SourceManager

A manager for the map control's sources. Exposed through the sources property of the atlas.Map class. Cannot be instantiated by the user.

StyleControlOptions

The options for a StyleControl object.

StyleOptions

The options for the map's style.

SymbolLayerOptions

Options used when rendering geometries in a SymbolLayer.

TargetedEvent
TextOptions

Options used to customize the text in a SymbolLayer

TileLayerOptions

Options used when rendering raster tiled images in a TileLayer.

TrafficOptions

The options for setting traffic on the map.

UserInteractionOptions

The options for enabling/disabling user interaction with the map.

VectorTileSourceOptions

A data source for managing shape data that will be displayed on the map. A data source must be added to a layer before it is visible on the map. Options for a VectorTileSource.

ZoomControlOptions

The options for a ZoomControl object.

Type Aliases

getAuthTokenCallback

The callback function used to acquire an authentication token in anonymous authentication mode. Resolve with the authentication token or reject with any errors.

Enums

AuthenticationType

An enumeration used to specify the type of authentication mechanism to use.

ControlPosition

Positions where the control can be placed on the map.

ControlStyle

Available styles for a Control.

Functions

addImageTemplate(string, string, boolean)

Adds an image template to the atlas namespace.

getAllImageTemplateNames()

Retrieves an array of names for all image templates that are available in the atlas namespace.

getAuthenticationOptions()

Gets the default authentication options that were provided. If not previously set all properties will be undefined.

getImageTemplate(string, number)

Retrieves an SVG template by name.

getLanguage()

Gets the default language that was provided. If not previously set, the default value is "NGT".

getSessionId()

Gets the default session id that was provided. If not previously set, the default value is a random UUID.

getSubscriptionKey()

Gets the default Azure Maps subscription key that was provided.

getTilesetId()

Gets the default tileset id that was provided.

getUserRegion()
getVersion()

Current API version number based on build number.

getView()

Gets the default view setting of the map control. If not previously set the default value is undefined.

isSupported(boolean)

Checks to see if the user's browser is supported by the map control.

setAuthenticationOptions(AuthenticationOptions)

Sets your authentication options as the default options in the atlas namespace which is used by the map control and any modules that make requests to the Azure maps services. If a Map is initialized with the authentication options explicitly defined and setAuthenticationOptions hasn't previously been called it will automatically be called by the Map constructor.

setLanguage(string)

Sets the default language used by the map and service modules unless the language is explicitly specified when using those parts of the API. If a Map is initialized with the language explicitly defined and setLanguage hasn't previously been called it will automatically be called by the Map constructor.

setSessionId(string)

Sets the default session id used by the map and service modules unless the session id is explicitly specified when using those parts of the API. If a Map is initialized with the session ID explicitly defined and setSessionId hasn't previously been called it will automatically be called by the Map constructor.

setSubscriptionKey(string)

Sets your Azure Maps subscription key as the default subscription key in the atlas namespace which is used by the map control and any modules that make requests to the Azure maps services. If a Map is initialized with the subscription key explicitly defined and setSubscriptionKey hasn't previously been called it will automatically be called by the Map constructor.

setTilesetId(string)

Sets the default tileset id used by the map and service modules unless the tileset id is explicitly specified when using those parts of the API. If a Map is initialized with the tileset ID explicitly defined and setTilesetId hasn't previously been called it will automatically be called by the Map constructor.

setUserRegion(string)
setView(string)

Specifies which set of geopolitically disputed borders and labels are displayed on the map. The View parameter (also referred to as “user region parameter”) is a 2-letter ISO-3166 Country Code that will show the correct maps for that country/region. Country/Regions that are not on the View list or if unspecified will default to the “Unified” View. Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews }. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.

Function Details

addImageTemplate(string, string, boolean)

Adds an image template to the atlas namespace.

function addImageTemplate(templateName: string, template: string, override: boolean)

Parameters

templateName
string

The name of the template.

template
string

The SVG template to add. Supports {color}, {secondaryColor}, {scale}, {text}.

override
boolean

Specifies if it should override existing templates if one with the same name already exists.

getAllImageTemplateNames()

Retrieves an array of names for all image templates that are available in the atlas namespace.

function getAllImageTemplateNames()

Returns

string[]

getAuthenticationOptions()

Gets the default authentication options that were provided. If not previously set all properties will be undefined.

function getAuthenticationOptions()

Returns

getImageTemplate(string, number)

Retrieves an SVG template by name.

function getImageTemplate(templateName: string, scale?: number)

Parameters

templateName
string

The name of the template to retrieve.

scale
number

Specifies how much to scale the template. For best results, scale the icon to the maximum size you want to display it on the map, then use the symbol layers icon size option to scale down if needed. This will reduce blurriness due to scaling. Default: 1

Returns

string

getLanguage()

Gets the default language that was provided. If not previously set, the default value is "NGT".

function getLanguage()

Returns

string

getSessionId()

Gets the default session id that was provided. If not previously set, the default value is a random UUID.

function getSessionId()

Returns

string

getSubscriptionKey()

Gets the default Azure Maps subscription key that was provided.

function getSubscriptionKey()

Returns

string

getTilesetId()

Gets the default tileset id that was provided.

function getTilesetId()

Returns

string

getUserRegion()

Warning

This API is now obsolete.

use atlas.getView() instead

function getUserRegion()

Returns

string

getVersion()

Current API version number based on build number.

function getVersion()

Returns

string

getView()

Gets the default view setting of the map control. If not previously set the default value is undefined.

function getView()

Returns

string

isSupported(boolean)

Checks to see if the user's browser is supported by the map control.

function isSupported(failIfMajorPerformanceCaveat?: boolean)

Parameters

failIfMajorPerformanceCaveat
boolean

If true the function will return false if the performance of the map control would be dramatically worse than expected (e.g. a software WebGL renderer would be used).

Returns

boolean

setAuthenticationOptions(AuthenticationOptions)

Sets your authentication options as the default options in the atlas namespace which is used by the map control and any modules that make requests to the Azure maps services. If a Map is initialized with the authentication options explicitly defined and setAuthenticationOptions hasn't previously been called it will automatically be called by the Map constructor.

function setAuthenticationOptions(options: AuthenticationOptions)

Parameters

options
AuthenticationOptions

The new default authentication options.

setLanguage(string)

Sets the default language used by the map and service modules unless the language is explicitly specified when using those parts of the API. If a Map is initialized with the language explicitly defined and setLanguage hasn't previously been called it will automatically be called by the Map constructor.

function setLanguage(language: string)

Parameters

language
string

The new default language.

setSessionId(string)

Sets the default session id used by the map and service modules unless the session id is explicitly specified when using those parts of the API. If a Map is initialized with the session ID explicitly defined and setSessionId hasn't previously been called it will automatically be called by the Map constructor.

function setSessionId(id: string)

Parameters

id
string

The new default session id.

setSubscriptionKey(string)

Sets your Azure Maps subscription key as the default subscription key in the atlas namespace which is used by the map control and any modules that make requests to the Azure maps services. If a Map is initialized with the subscription key explicitly defined and setSubscriptionKey hasn't previously been called it will automatically be called by the Map constructor.

function setSubscriptionKey(key: string)

Parameters

key
string

The new default subscription key.

setTilesetId(string)

Sets the default tileset id used by the map and service modules unless the tileset id is explicitly specified when using those parts of the API. If a Map is initialized with the tileset ID explicitly defined and setTilesetId hasn't previously been called it will automatically be called by the Map constructor.

function setTilesetId(id: string)

Parameters

id
string

The new default tileset id.

setUserRegion(string)

Warning

This API is now obsolete.

use atlas.setView(view: string) instead

function setUserRegion(userRegion: string)

Parameters

userRegion
string

setView(string)

Specifies which set of geopolitically disputed borders and labels are displayed on the map. The View parameter (also referred to as “user region parameter”) is a 2-letter ISO-3166 Country Code that will show the correct maps for that country/region. Country/Regions that are not on the View list or if unspecified will default to the “Unified” View. Please see the supported [Views]{@link https://aka.ms/AzureMapsLocalizationViews }. It is your responsibility to determine the location of your users, and then set the View parameter correctly for that location. The View parameter in Azure Maps must be used in compliance with applicable laws, including those regarding mapping, of the country where maps, images and other data and third party content that You are authorized to access via Azure Maps is made available.

function setView(view: string)

Parameters

view
string

The new default view