---
title: "Map | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Class Map`Maptiler`

The Map class can be instanciated to display a map in a `<div>`

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#Map))

-   [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/)
    -   Map

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Properties[](#properties)

[boxZoom](#boxzoom) [cameraHelper](#camerahelper) [cancelPendingTileRequestsWhileZooming](#cancelpendingtilerequestswhilezooming) [cooperativeGestures](#cooperativegestures) [doubleClickZoom](#doubleclickzoom) [dragPan](#dragpan) [dragRotate](#dragrotate) [handlers](#handlers) [keyboard](#keyboard) [painter](#painter) [scrollZoom](#scrollzoom) [style](#style) [telemetry](#telemetry) [terrain](#terrain) [touchPitch](#touchpitch) [touchZoomRotate](#touchzoomrotate) [transform](#transform) [transformCameraUpdate](#transformcameraupdate) [transformConstrain](#transformconstrain)

### Accessors[](#accessors)

[repaint](#repaint) [showCollisionBoxes](#showcollisionboxes) [showOverdrawInspector](#showoverdrawinspector) [showPadding](#showpadding) [showTileBoundaries](#showtileboundaries) [version](#version) [vertices](#vertices)

### Methods[](#methods)

[addControl](#addcontrol) [addImage](#addimage) [addLayer](#addlayer) [addSource](#addsource) [addSprite](#addsprite) [areTilesLoaded](#aretilesloaded) [calculateCameraOptionsFromCameraLngLatAltRotation](#calculatecameraoptionsfromcameralnglataltrotation) [calculateCameraOptionsFromTo](#calculatecameraoptionsfromto) [cameraForBounds](#cameraforbounds) [centerOnIpPoint](#centeronippoint) [coveringTiles](#coveringtiles) [disableHaloAnimations](#disablehaloanimations) [disableSpaceAnimations](#disablespaceanimations) [disableTerrain](#disableterrain) [easeTo](#easeto) [enableHaloAnimations](#enablehaloanimations) [enableSpaceAnimations](#enablespaceanimations) [enableTerrain](#enableterrain) [experimental\_preloadTiles](#experimental_preloadtiles) [experimental\_preloadTilesForBounds](#experimental_preloadtilesforbounds) [experimental\_preloadTilesForCameraPositions](#experimental_preloadtilesforcamerapositions) [fire](#fire) [fitBounds](#fitbounds) [fitScreenCoordinates](#fitscreencoordinates) [fitToIpBounds](#fittoipbounds) [flyTo](#flyto) [forgetPersistedProjection](#forgetpersistedprojection) [getAnisotropicFilterPitch](#getanisotropicfilterpitch) [getBearing](#getbearing) [getBounds](#getbounds) [getCameraHash](#getcamerahash) [getCameraTargetElevation](#getcameratargetelevation) [getCanvas](#getcanvas) [getCanvasContainer](#getcanvascontainer) [getCenter](#getcenter) [getCenterClampedToGround](#getcenterclampedtoground) [getCenterElevation](#getcenterelevation) [getContainer](#getcontainer) [getFeatureState](#getfeaturestate) [getFilter](#getfilter) [getGlobalState](#getglobalstate) [getGlyphs](#getglyphs) [getHalo](#gethalo) [getImage](#getimage) [getLayer](#getlayer) [getLayersOrder](#getlayersorder) [getLayoutProperty](#getlayoutproperty) [getLight](#getlight) [getMaptilerSessionId](#getmaptilersessionid) [getMaxBounds](#getmaxbounds) [getMaxPitch](#getmaxpitch) [getMaxZoom](#getmaxzoom) [getMinPitch](#getminpitch) [getMinZoom](#getminzoom) [getPadding](#getpadding) [getPaintProperty](#getpaintproperty) [getPitch](#getpitch) [getPixelRatio](#getpixelratio) [getPrimaryLanguage](#getprimarylanguage) [getProjection](#getprojection) [getRenderWorldCopies](#getrenderworldcopies) [getRoll](#getroll) [getSdkConfig](#getsdkconfig) [getSky](#getsky) [getSource](#getsource) [getSpace](#getspace) [getSprite](#getsprite) [getStyle](#getstyle) [getTerrain](#getterrain) [getTerrainExaggeration](#getterrainexaggeration) [getVerticalFieldOfView](#getverticalfieldofview) [getZoom](#getzoom) [getZoomSnap](#getzoomsnap) [hasControl](#hascontrol) [hasImage](#hasimage) [hasTerrain](#hasterrain) [isEasing](#iseasing) [isGlobeProjection](#isglobeprojection) [isLanguageUpdated](#islanguageupdated) [isMoving](#ismoving) [isRotating](#isrotating) [isSourceLoaded](#issourceloaded) [isStyleLoaded](#isstyleloaded) [isZooming](#iszooming) [jumpTo](#jumpto) [listens](#listens) [listImages](#listimages) [loaded](#loaded) [loadImage](#loadimage) [migrateProjection](#migrateprojection) [moveLayer](#movelayer) [off](#off) [on](#on) [once](#once) [onLoadAsync](#onloadasync) [onLoadWithTerrainAsync](#onloadwithterrainasync) [onReadyAsync](#onreadyasync) [panBy](#panby) [panTo](#panto) [project](#project) [queryRenderedFeatures](#queryrenderedfeatures) [querySourceFeatures](#querysourcefeatures) [queryTerrainElevation](#queryterrainelevation) [recreate](#recreate) [redraw](#redraw) [refreshTiles](#refreshtiles) [remove](#remove) [removeControl](#removecontrol) [removeFeatureState](#removefeaturestate) [removeImage](#removeimage) [removeLayer](#removelayer) [removeSource](#removesource) [removeSprite](#removesprite) [resetNorth](#resetnorth) [resetNorthPitch](#resetnorthpitch) [resize](#resize) [rotateTo](#rotateto) [setAnisotropicFilterPitch](#setanisotropicfilterpitch) [setBearing](#setbearing) [setCenter](#setcenter) [setCenterClampedToGround](#setcenterclampedtoground) [setCenterElevation](#setcenterelevation) [setEventedParent](#seteventedparent) [setFeatureState](#setfeaturestate) [setFilter](#setfilter) [setGlobalStateProperty](#setglobalstateproperty) [setGlyphs](#setglyphs) [setHalo](#sethalo) [setHaloAnimationActive](#sethaloanimationactive) [setLanguage](#setlanguage) [setLayerZoomRange](#setlayerzoomrange) [setLayoutProperty](#setlayoutproperty) [setLight](#setlight) [setMaxBounds](#setmaxbounds) [setMaxPitch](#setmaxpitch) [setMaxZoom](#setmaxzoom) [setMinPitch](#setminpitch) [setMinZoom](#setminzoom) [setPadding](#setpadding) [setPaintProperty](#setpaintproperty) [setPitch](#setpitch) [setPixelRatio](#setpixelratio) [setProjection](#setprojection) [setRenderWorldCopies](#setrenderworldcopies) [setRoll](#setroll) [setSky](#setsky) [setSourceTileLodParams](#setsourcetilelodparams) [setSpace](#setspace) [setSpaceAnimationActive](#setspaceanimationactive) [setSprite](#setsprite) [setStyle](#setstyle) [setTerrain](#setterrain) [setTerrainAnimationDuration](#setterrainanimationduration) [setTerrainExaggeration](#setterrainexaggeration) [setTransformConstrain](#settransformconstrain) [setTransformRequest](#settransformrequest) [setVerticalFieldOfView](#setverticalfieldofview) [setZoom](#setzoom) [setZoomSnap](#setzoomsnap) [snapToNorth](#snaptonorth) [stop](#stop) [triggerRepaint](#triggerrepaint) [unproject](#unproject) [updateImage](#updateimage) [zoomIn](#zoomin) [zoomOut](#zoomout) [zoomTo](#zoomto)

## Constructors[](#constructors-1)

### `Maptiler`constructor[](#constructor)

-   new Map(options: [MapOptions](https://docs.maptiler.com/sdk-js/api-reference/types/MapOptions/)): Map[](#constructormap)
    
    #### Parameters
    
    -   options: [MapOptions](https://docs.maptiler.com/sdk-js/api-reference/types/MapOptions/)
    
    #### Returns Map
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[constructor](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#constructor)
    

## Properties[](#properties-1)

### boxZoom[](#boxzoom)

boxZoom: [BoxZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.BoxZoomHandler/)

The map's [BoxZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.BoxZoomHandler/), which implements zooming using a drag gesture with the Shift key pressed. Find more details and examples using `boxZoom` in the [BoxZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.BoxZoomHandler/) section.

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[boxZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#boxzoom)

### cameraHelper[](#camerahelper)

cameraHelper: [ICameraHelper](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ICameraHelper/)

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[cameraHelper](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#camerahelper)

### cancelPendingTileRequestsWhileZooming[](#cancelpendingtilerequestswhilezooming)

cancelPendingTileRequestsWhileZooming: boolean

The map's property which determines whether to cancel, or retain, tiles from the current viewport which are still loading but which belong to a farther (smaller) zoom level than the current one.

-   If `true`, when zooming in, tiles which didn't manage to load for previous zoom levels will become canceled. This might save some computing resources for slower devices, but the map details might appear more abruptly at the end of the zoom.
-   If `false`, when zooming in, the previous zoom level(s) tiles will progressively appear, giving a smoother map details experience. However, more tiles will be rendered in a short period of time.

#### Default Value[](#default-value)

```typescript
true
```

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[cancelPendingTileRequestsWhileZooming](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#cancelpendingtilerequestswhilezooming)

### cooperativeGestures[](#cooperativegestures)

cooperativeGestures: [CooperativeGesturesHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.CooperativeGesturesHandler/)

The map's [CooperativeGesturesHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.CooperativeGesturesHandler/), which allows the user to see cooperative gesture info when user tries to zoom in/out. Find more details and examples using `cooperativeGestures` in the [CooperativeGesturesHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.CooperativeGesturesHandler/) section.

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[cooperativeGestures](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#cooperativegestures)

### doubleClickZoom[](#doubleclickzoom)

doubleClickZoom: [DoubleClickZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DoubleClickZoomHandler/)

The map's [DoubleClickZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DoubleClickZoomHandler/), which allows the user to zoom by double clicking. Find more details and examples using `doubleClickZoom` in the [DoubleClickZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DoubleClickZoomHandler/) section.

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[doubleClickZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#doubleclickzoom)

### dragPan[](#dragpan)

dragPan: [DragPanHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DragPanHandler/)

The map's [DragPanHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DragPanHandler/), which implements dragging the map with a mouse or touch gesture. Find more details and examples using `dragPan` in the [DragPanHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DragPanHandler/) section.

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[dragPan](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#dragpan)

### dragRotate[](#dragrotate)

dragRotate: [DragRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DragRotateHandler/)

The map's [DragRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DragRotateHandler/), which implements rotating the map while dragging with the right mouse button or with the Control key pressed. Find more details and examples using `dragRotate` in the [DragRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.DragRotateHandler/) section.

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[dragRotate](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#dragrotate)

### handlers[](#handlers)

handlers: [HandlerManager](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.HandlerManager/)

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[handlers](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#handlers)

### keyboard[](#keyboard)

keyboard: [KeyboardHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.KeyboardHandler/)

The map's [KeyboardHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.KeyboardHandler/), which allows the user to zoom, rotate, and pan the map using keyboard shortcuts. Find more details and examples using `keyboard` in the [KeyboardHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.KeyboardHandler/) section.

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[keyboard](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#keyboard)

### painter[](#painter)

painter: [Painter](https://docs.maptiler.com/sdk-js/api-reference/classes/Painter/)

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[painter](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#painter)

### scrollZoom[](#scrollzoom)

scrollZoom: [ScrollZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.ScrollZoomHandler/)

The map's [ScrollZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.ScrollZoomHandler/), which implements zooming in and out with a scroll wheel or trackpad. Find more details and examples using `scrollZoom` in the [ScrollZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.ScrollZoomHandler/) section.

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[scrollZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#scrollzoom)

### style[](#style)

style: [Style](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Style/)

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[style](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#style)

### `Readonly` `Maptiler`telemetry[](#telemetry)

telemetry: [Telemetry](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Telemetry/)

### terrain[](#terrain)

terrain: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#terrain)

### touchPitch[](#touchpitch)

touchPitch: [TwoFingersTouchPitchHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.TwoFingersTouchPitchHandler/)

The map's [TwoFingersTouchPitchHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.TwoFingersTouchPitchHandler/), which allows the user to pitch the map with touch gestures. Find more details and examples using `touchPitch` in the [TwoFingersTouchPitchHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.TwoFingersTouchPitchHandler/) section.

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[touchPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#touchpitch)

### touchZoomRotate[](#touchzoomrotate)

touchZoomRotate: [TwoFingersTouchZoomRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.TwoFingersTouchZoomRotateHandler/)

The map's [TwoFingersTouchZoomRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.TwoFingersTouchZoomRotateHandler/), which allows the user to zoom or rotate the map with touch gestures. Find more details and examples using `touchZoomRotate` in the [TwoFingersTouchZoomRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.TwoFingersTouchZoomRotateHandler/) section.

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[touchZoomRotate](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#touchzoomrotate)

### transform[](#transform)

transform: [ITransform](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ITransform/)

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[transform](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#transform)

### transformCameraUpdate[](#transformcameraupdate)

transformCameraUpdate: [CameraUpdateTransformFunction](https://docs.maptiler.com/sdk-js/api-reference/types/CameraUpdateTransformFunction/) | null

A callback used to defer camera updates or apply arbitrary constraints. If specified, this Camera instance can be used as a stateless component in React etc.

Inherited from [Camera](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Camera/).[transformCameraUpdate](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Camera/#transformcameraupdate)

### transformConstrain[](#transformconstrain)

transformConstrain: [TransformConstrainFunction](https://docs.maptiler.com/sdk-js/api-reference/types/TransformConstrainFunction/) | null

The map transform's callback that overrides the default constrain function.

#### Default Value[](#default-value-1)

```typescript
null
```

Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[transformConstrain](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#transformconstrain)

## Accessors[](#accessors-1)

### repaint[](#repaint)

-   get repaint(): boolean
    
    Gets and sets a Boolean indicating whether the map will continuously repaint. This information is useful for analyzing performance.
    
    #### Returns boolean
    
    Inherited from maplibregl.Map.repaint
    
-   set repaint(value: boolean): void
    
    #### Parameters
    
    -   value: boolean
    
    #### Returns void
    
    Inherited from maplibregl.Map.repaint
    

### showCollisionBoxes[](#showcollisionboxes)

-   get showCollisionBoxes(): boolean
    
    Gets and sets a Boolean indicating whether the map will render boxes around all symbols in the data source, revealing which symbols were rendered or which were hidden due to collisions. This information is useful for debugging.
    
    #### Returns boolean
    
    Inherited from maplibregl.Map.showCollisionBoxes
    
-   set showCollisionBoxes(value: boolean): void
    
    #### Parameters
    
    -   value: boolean
    
    #### Returns void
    
    Inherited from maplibregl.Map.showCollisionBoxes
    

### showOverdrawInspector[](#showoverdrawinspector)

-   get showOverdrawInspector(): boolean
    
    Gets and sets a Boolean indicating whether the map should color-code each fragment to show how many times it has been shaded. White fragments have been shaded 8 or more times. Black fragments have been shaded 0 times. This information is useful for debugging.
    
    #### Returns boolean
    
    Inherited from maplibregl.Map.showOverdrawInspector
    
-   set showOverdrawInspector(value: boolean): void
    
    #### Parameters
    
    -   value: boolean
    
    #### Returns void
    
    Inherited from maplibregl.Map.showOverdrawInspector
    

### showPadding[](#showpadding)

-   get showPadding(): boolean
    
    Gets and sets a Boolean indicating whether the map will visualize the padding offsets.
    
    #### Returns boolean
    
    Inherited from maplibregl.Map.showPadding
    
-   set showPadding(value: boolean): void
    
    #### Parameters
    
    -   value: boolean
    
    #### Returns void
    
    Inherited from maplibregl.Map.showPadding
    

### showTileBoundaries[](#showtileboundaries)

-   get showTileBoundaries(): boolean
    
    Gets and sets a Boolean indicating whether the map will render an outline around each tile and the tile ID. These tile boundaries are useful for debugging.
    
    The uncompressed file size of the first vector source is drawn in the top left corner of each tile, next to the tile ID.
    
    #### Returns boolean
    
    #### Example[](#example)
    
    ```typescript
    map.showTileBoundaries = true;
    ```
    
    Inherited from maplibregl.Map.showTileBoundaries
    
-   set showTileBoundaries(value: boolean): void
    
    #### Parameters
    
    -   value: boolean
    
    #### Returns void
    
    Inherited from maplibregl.Map.showTileBoundaries
    

### version[](#version)

-   get version(): string
    
    Returns the package version of the library
    
    #### Returns string
    
    Package version of the library
    
    Inherited from maplibregl.Map.version
    

### vertices[](#vertices)

-   get vertices(): boolean
    
    #### Returns boolean
    
    Inherited from maplibregl.Map.vertices
    
-   set vertices(value: boolean): void
    
    #### Parameters
    
    -   value: boolean
    
    #### Returns void
    
    Inherited from maplibregl.Map.vertices
    

## Methods[](#methods-1)

### addControl[](#addcontrol)

-   addControl(control: [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/), position?: [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/)): this[](#addcontrol-1)
    
    Adds an [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/) to the map, calling `control.onAdd(this)`.
    
    An [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) will be fired if the control is invalid.
    
    #### Parameters
    
    -   control: [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/)
        
        The [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/) to add.
        
    -   `Optional`position: [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/)
        
        position on the map to which the control will be added. Valid values are `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`. Defaults to `'top-right'`.
        
    
    #### Returns this
    
    #### Example[](#example-1)
    
    Add zoom and rotation controls to the map.
    
    ```typescript
    map.addControl(new NavigationControl());
    ```
    
    #### See[](#see)
    
    [Display map navigation controls](https://maplibre.org/maplibre-gl-js/docs/examples/display-map-navigation-controls/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[addControl](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#addcontrol)
    

### addImage[](#addimage)

-   addImage(  
        id: string,  
        image:  
            | [ImageBitmap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageBitmap/)  
            | [StyleImageInterface](https://docs.maptiler.com/sdk-js/api-reference/interfaces/StyleImageInterface/)  
            | [ImageData](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageData/)  
            | [HTMLImageElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLImageElement/)  
            | {  
                data: Uint8Array<[ArrayBufferLike](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ArrayBufferLike/)\>  
                | Uint8ClampedArray<[ArrayBufferLike](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ArrayBufferLike/)\>;  
                height: number;  
                width: number;  
            },  
        options?: [Partial](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Partial/)<[StyleImageMetadata](https://docs.maptiler.com/sdk-js/api-reference/types/StyleImageMetadata/)\>,  
    ): this[](#addimage-1)
    
    Add an image to the style. This image can be displayed on the map like any other icon in the style's sprite using the image's ID with [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image), [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern), [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern), or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).
    
    A [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) event will be fired if the image parameter is invalid or there is not enough space in the sprite to add this image.
    
    #### Parameters
    
    -   id: string
        
        The ID of the image.
        
    -   image:  
            | [ImageBitmap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageBitmap/)  
            | [StyleImageInterface](https://docs.maptiler.com/sdk-js/api-reference/interfaces/StyleImageInterface/)  
            | [ImageData](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageData/)  
            | [HTMLImageElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLImageElement/)  
            | {  
                data: Uint8Array<[ArrayBufferLike](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ArrayBufferLike/)\>  
                | Uint8ClampedArray<[ArrayBufferLike](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ArrayBufferLike/)\>;  
                height: number;  
                width: number;  
            }
        
        The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data` properties with the same format as `ImageData`.
        
    -   `Optional`options: [Partial](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Partial/)<[StyleImageMetadata](https://docs.maptiler.com/sdk-js/api-reference/types/StyleImageMetadata/)\>
        
        Options object.
        
    
    #### Returns this
    
    #### Example[](#example-2)
    
    ```typescript
    // If the style's sprite does not already contain an image with ID 'cat',
    // add the image 'cat-icon.png' to the style's sprite with the ID 'cat'.
    const image = await map.loadImage('https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Cat_silhouette.svg/400px-Cat_silhouette.svg.png');
    if (!map.hasImage('cat')) map.addImage('cat', image.data);
    
    // Add a stretchable image that can be used with `icon-text-fit`
    // In this example, the image is 600px wide by 400px high.
    const image = await map.loadImage('https://upload.wikimedia.org/wikipedia/commons/8/89/Black_and_White_Boxed_%28bordered%29.png');
    if (map.hasImage('border-image')) return;
    map.addImage('border-image', image.data, {
        content: [16, 16, 300, 384], // place text over left half of image, avoiding the 16px border
        stretchX: [[16, 584]], // stretch everything horizontally except the 16px border
        stretchY: [[16, 384]], // stretch everything vertically except the 16px border
    });
    ```
    
    #### See[](#see-1)
    
    -   Use `HTMLImageElement`: [Add an icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-an-icon-to-the-map/)
    -   Use `ImageData`: [Add a generated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-generated-icon-to-the-map/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[addImage](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#addimage)
    

### `Maptiler`addLayer[](#addlayer)

-   addLayer(  
        layer:  
            | [CustomLayerInterface](https://docs.maptiler.com/sdk-js/api-reference/interfaces/CustomLayerInterface/)  
            | (  
                LayerSpecification & { source?: string | SourceSpecification | undefined; }  
            ),  
        beforeId?: string,  
    ): this[](#addlayer-1)
    
    Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers) to the map's style.
    
    A layer defines how data from a specified source will be styled. Read more about layer types and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/layers).
    
    #### Parameters
    
    -   layer:  
            | [CustomLayerInterface](https://docs.maptiler.com/sdk-js/api-reference/interfaces/CustomLayerInterface/)  
            | (  
                LayerSpecification & { source?: string | SourceSpecification | undefined; }  
            )
        
        The layer to add, conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec/layers) or, less commonly, the [CustomLayerInterface](https://docs.maptiler.com/sdk-js/api-reference/interfaces/CustomLayerInterface/) specification. The MapLibre Style Specification's layer definition is appropriate for most layers.
        
    -   `Optional`beforeId: string
        
        The ID of an existing layer to insert the new layer before, resulting in the new layer appearing visually beneath the existing layer. If this argument is not specified, the layer will be appended to the end of the layers array and appear visually above all other layers.
        
    
    #### Returns this
    
    `this`
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[addLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#addlayer)
    

### addSource[](#addsource)

-   addSource(  
        id: string,  
        source: [CanvasSourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/CanvasSourceSpecification/) | [SourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/SourceSpecification/),  
    ): this[](#addsource-1)
    
    Adds a source to the map's style.
    
    Events triggered:
    
    Triggers the `source.add` event.
    
    #### Parameters
    
    -   id: string
        
        The ID of the source to add. Must not conflict with existing sources.
        
    -   source: [CanvasSourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/CanvasSourceSpecification/) | [SourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/SourceSpecification/)
        
        The source object, conforming to the MapLibre Style Specification's [source definition](https://maplibre.org/maplibre-style-spec/sources) or [CanvasSourceSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/CanvasSourceSpecification/).
        
    
    #### Returns this
    
    #### Example[](#example-3)
    
    ```typescript
    map.addSource('my-data', {
      type: 'vector',
      url: 'https://demotiles.maplibre.org/tiles/tiles.json'
    });
    ```
    
    #### Example[](#example-4)
    
    ```typescript
    map.addSource('my-data', {
      "type": "geojson",
      "data": {
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [-77.0323, 38.9131]
        },
        "properties": {
          "title": "Mapbox DC",
          "marker-symbol": "monument"
        }
      }
    });
    ```
    
    #### See[](#see-2)
    
    GeoJSON source: [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/add-live-realtime-data/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[addSource](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#addsource)
    

### addSprite[](#addsprite)

-   addSprite(id: string, url: string, options?: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)): this[](#addsprite-1)
    
    Adds a sprite to the map's style. Fires the `style` event.
    
    #### Parameters
    
    -   id: string
        
        The ID of the sprite to add. Must not conflict with existing sprites.
        
    -   url: string
        
        The URL to load the sprite from
        
    -   `Optional`options: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)
        
        Options object.
        
    
    #### Returns this
    
    #### Example[](#example-5)
    
    ```typescript
    map.addSprite('sprite-two', 'http://example.com/sprite-two');
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[addSprite](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#addsprite)
    

### areTilesLoaded[](#aretilesloaded)

-   areTilesLoaded(): boolean[](#aretilesloaded-1)
    
    Returns a Boolean indicating whether all tiles in the viewport from all sources on the style are loaded.
    
    #### Returns boolean
    
    A Boolean indicating whether all tiles are loaded.
    
    #### Example[](#example-6)
    
    ```typescript
    let tilesLoaded = map.areTilesLoaded();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[areTilesLoaded](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#aretilesloaded)
    

### calculateCameraOptionsFromCameraLngLatAltRotation[](#calculatecameraoptionsfromcameralnglataltrotation)

-   calculateCameraOptionsFromCameraLngLatAltRotation(  
        cameraLngLat: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/),  
        cameraAlt: number,  
        bearing: number,  
        pitch: number,  
        roll?: number,  
    ): [CameraOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CameraOptions/)[](#calculatecameraoptionsfromcameralnglataltrotation-1)
    
    Given a camera position and rotation, calculates zoom and center point and returns them as [CameraOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CameraOptions/).
    
    #### Parameters
    
    -   cameraLngLat: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/)
        
        The lng, lat of the camera to look from
        
    -   cameraAlt: number
        
        The altitude of the camera to look from, in meters above sea level
        
    -   bearing: number
        
        Bearing of the camera, in degrees
        
    -   pitch: number
        
        Pitch of the camera, in degrees
        
    -   `Optional`roll: number
        
        Roll of the camera, in degrees
        
    
    #### Returns [CameraOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CameraOptions/)
    
    the calculated camera options
    
    #### Example[](#example-7)
    
    ```typescript
    // Calculate options to look from camera position(1°, 0°, 1000m) with bearing = 90°, pitch = 30°, and roll = 45°
    const cameraLngLat = new LngLat(1, 0);
    const cameraAltitude = 1000;
    const bearing = 90;
    const pitch = 30;
    const roll = 45;
    const cameraOptions = map.calculateCameraOptionsFromCameraLngLatAltRotation(cameraLngLat, cameraAltitude, bearing, pitch, roll);
    // Apply calculated options
    map.jumpTo(cameraOptions);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[calculateCameraOptionsFromCameraLngLatAltRotation](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#calculatecameraoptionsfromcameralnglataltrotation)
    

### calculateCameraOptionsFromTo[](#calculatecameraoptionsfromto)

-   calculateCameraOptionsFromTo(  
        from: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/),  
        altitudeFrom: number,  
        to: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/),  
        altitudeTo?: number,  
    ): [CameraOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CameraOptions/)[](#calculatecameraoptionsfromto-1)
    
    Given a camera 'from' position and a position to look at (`to`), calculates zoom and camera rotation and returns them as [CameraOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CameraOptions/).
    
    #### Parameters
    
    -   from: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
        
        The camera to look from
        
    -   altitudeFrom: number
        
        The altitude of the camera to look from
        
    -   to: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
        
        The center to look at
        
    -   `Optional`altitudeTo: number
        
        Optional altitude of the center to look at. If none given the ground height will be used.
        
    
    #### Returns [CameraOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CameraOptions/)
    
    the calculated camera options
    
    #### Example[](#example-8)
    
    ```typescript
    // Calculate options to look from (1°, 0°, 1000m) to (1°, 1°, 0m)
    const cameraLngLat = new LngLat(1, 0);
    const cameraAltitude = 1000;
    const targetLngLat = new LngLat(1, 1);
    const targetAltitude = 0;
    const cameraOptions = map.calculateCameraOptionsFromTo(cameraLngLat, cameraAltitude, targetLngLat, targetAltitude);
    // Apply calculated options
    map.jumpTo(cameraOptions);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[calculateCameraOptionsFromTo](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#calculatecameraoptionsfromto)
    

### cameraForBounds[](#cameraforbounds)

-   cameraForBounds(  
        bounds: [LngLatBoundsLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatBoundsLike/),  
        options?: [CameraForBoundsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CameraForBoundsOptions/),  
    ): [CenterZoomBearing](https://docs.maptiler.com/sdk-js/api-reference/types/CenterZoomBearing/) | undefined[](#cameraforbounds-1)
    
    #### Parameters
    
    -   bounds: [LngLatBoundsLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatBoundsLike/)
        
        Calculate the center for these bounds in the viewport and use the highest zoom level up to and including [Map.getMaxZoom](#getmaxzoom) that fits in the viewport. LngLatBounds represent a box that is always axis-aligned with bearing 0. Bounds will be taken in \[sw, ne\] order. Southwest point will always be to the left of the northeast point.
        
    -   `Optional`options: [CameraForBoundsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CameraForBoundsOptions/)
        
        Options object
        
    
    #### Returns [CenterZoomBearing](https://docs.maptiler.com/sdk-js/api-reference/types/CenterZoomBearing/) | undefined
    
    If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`. If map is unable to fit, method will warn and return undefined.
    
    #### Example[](#example-9)
    
    ```typescript
    let bbox = [[-79, 43], [-73, 45]];
    let newCameraTransform = map.cameraForBounds(bbox, {
      padding: {top: 10, bottom:25, left: 15, right: 5}
    });
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[cameraForBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#cameraforbounds)
    

### `Maptiler`centerOnIpPoint[](#centeronippoint)

-   centerOnIpPoint(zoom: number | undefined): Promise<void\>[](#centeronippoint-1)
    
    #### Parameters
    
    -   zoom: number | undefined
    
    #### Returns Promise<void\>
    

### coveringTiles[](#coveringtiles)

-   coveringTiles(options: [CoveringTilesOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CoveringTilesOptions/)): [OverscaledTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/OverscaledTileID/)\[\][](#coveringtiles-1)
    
    Returns an array of `OverscaledTileID` objects that cover the current viewport for a given tile size. This method is useful for determining which tiles are visible in the current viewport.
    
    #### Parameters
    
    -   options: [CoveringTilesOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CoveringTilesOptions/)
        
        Options for calculating the covering tiles.
        
    
    #### Returns [OverscaledTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/OverscaledTileID/)\[\]
    
    An array of `OverscaledTileID` objects.
    
    #### Example[](#example-10)
    
    ```typescript
    // Get the tiles to cover the view for a 512x512px tile source
    const tiles = map.coveringTiles({tileSize: 512});
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[coveringTiles](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#coveringtiles)
    

### `Maptiler`disableHaloAnimations[](#disablehaloanimations)

-   disableHaloAnimations(): void[](#disablehaloanimations-1)
    
    Disables the animations for the halo layer.
    
    #### Returns void
    

### `Maptiler`disableSpaceAnimations[](#disablespaceanimations)

-   disableSpaceAnimations(): void[](#disablespaceanimations-1)
    
    Disables the animations for the space layer.
    
    #### Returns void
    

### `Maptiler`disableTerrain[](#disableterrain)

-   disableTerrain(): void[](#disableterrain-1)
    
    Disable the 3D terrain visualization
    
    #### Returns void
    

### `Maptiler`easeTo[](#easeto)

-   easeTo(options: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[EaseToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/EaseToOptions/)\>, eventData?: object): this[](#easeto-1)
    
    Changes any combination of center, zoom, bearing, pitch, and roll, with an animated transition between old and new values.
    
    If `options.experimental_preload` is provided, tiles along the ease path are fetched and cached before the animation begins.
    
    #### Parameters
    
    -   options: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[EaseToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/EaseToOptions/)\>
    -   `Optional`eventData: object
    
    #### Returns this
    
    #### Remarks[](#remarks)
    
    **API Key Usage**: When `experimental_preload` is set, tile requests are issued for positions sampled along the ease path. These count against your MapTiler Cloud API key quota.
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[easeTo](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#easeto)
    

### `Maptiler`enableHaloAnimations[](#enablehaloanimations)

-   enableHaloAnimations(): void[](#enablehaloanimations-1)
    
    Enables the animations for the halo layer.
    
    #### Returns void
    

### `Maptiler`enableSpaceAnimations[](#enablespaceanimations)

-   enableSpaceAnimations(): void[](#enablespaceanimations-1)
    
    Enables the animations for the space layer.
    
    #### Returns void
    

### `Maptiler`enableTerrain[](#enableterrain)

-   enableTerrain(exaggeration?: number): void[](#enableterrain-1)
    
    Enables the 3D terrain visualization
    
    #### Parameters
    
    -   exaggeration: number = ...
    
    #### Returns void
    

### `Maptiler`experimental\_preloadTiles[](#experimental_preloadtiles)

-   experimental\_preloadTiles(options: [PreloadTilesOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PreloadTilesOptions/)): Promise<void\>[](#experimental_preloadtiles-1)
    
    Preloads a specific set of tiles identified by their `"z/x/y"` tile IDs, storing them in the SDK tile cache.
    
    #### Parameters
    
    -   options: [PreloadTilesOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PreloadTilesOptions/)
        
        The options for the preload.
        
    
    #### Returns Promise<void\>
    
    A promise that resolves when the preload is complete.
    
    #### Experimental[](#experimental)
    
    #### Remarks[](#remarks-1)
    
    **API Key Usage**: Each tile ID results in one request per active source, counting against your MapTiler Cloud API key quota.
    
    #### Example[](#example-11)
    
    ```typescript
    await map.preloadTiles({
      tileIDs: ["12/1205/1540", "12/1206/1540"],
      onError: (err) => console.error(err),
    });
    ```
    

### `Maptiler`experimental\_preloadTilesForBounds[](#experimental_preloadtilesforbounds)

-   experimental\_preloadTilesForBounds(  
        options: [PreloadTilesForBoundsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PreloadTilesForBoundsOptions/),  
    ): Promise<void\>[](#experimental_preloadtilesforbounds-1)
    
    Preloads all tiles within a geographic bounds across a range of zoom levels, storing them in the SDK tile cache so subsequent renders are served instantly.
    
    #### Parameters
    
    -   options: [PreloadTilesForBoundsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PreloadTilesForBoundsOptions/)
        
        The options for the preload.
        
    
    #### Returns Promise<void\>
    
    A promise that resolves when the preload is complete.
    
    #### Remarks[](#remarks-2)
    
    **API Key Usage**: This method issues one tile request per tile per active source. Tile count grows exponentially with zoom level — a wide zoom range over a large area can trigger thousands of requests, each counting against your MapTiler Cloud API key quota. Use narrow zoom ranges and small bounds wherever possible, and monitor consumption via the `onProgress` callback.
    
    #### Experimental[](#experimental-1)
    
    #### Example[](#example-12)
    
    ```typescript
    await map.experimental_preloadTilesForBounds({
      bounds: map.getBounds(),
      minZoom: 8,
      maxZoom: 12,
    });
    ```
    

### `Maptiler`experimental\_preloadTilesForCameraPositions[](#experimental_preloadtilesforcamerapositions)

-   experimental\_preloadTilesForCameraPositions(  
        options: [PreloadTilesForCameraPositionsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PreloadTilesForCameraPositionsOptions/),  
    ): Promise<void\>[](#experimental_preloadtilesforcamerapositions-1)
    
    Preloads tiles visible from each of the given camera positions, storing them in the SDK tile cache so renders at those viewpoints are served instantly.
    
    Use this method before a planned `flyTo` or `panTo` to ensure tiles along the path are ready when the animation reaches them.
    
    #### Parameters
    
    -   options: [PreloadTilesForCameraPositionsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PreloadTilesForCameraPositionsOptions/)
        
        The options for the preload.
        
    
    #### Returns Promise<void\>
    
    A promise that resolves when the preload is complete.
    
    #### Experimental[](#experimental-2)
    
    #### Remarks[](#remarks-3)
    
    **API Key Usage**: Each position triggers one request per visible tile per active source. More positions at higher zoom levels significantly increase API usage, each request counting against your MapTiler Cloud API key quota.
    
    #### Example[](#example-13)
    
    ```typescript
    await map.preloadTilesForCameraPositions({
      positions: [
        { lng: -74.006, lat: 40.7128, zoom: 12 },
        { lng: -73.935, lat: 40.730,  zoom: 14 },
      ],
      onProgress: (done, total, tileID) => console.log(tileID),
    });
    ```
    

### fire[](#fire)

-   fire(event: string | [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/), properties?: any): this[](#fire-1)
    
    #### Parameters
    
    -   event: string | [Event](https://docs.maptiler.com/sdk-js/api-reference/classes/Event/)
    -   `Optional`properties: any
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[fire](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#fire)
    

### `Maptiler`fitBounds[](#fitbounds)

-   fitBounds(  
        bounds: [LngLatBoundsLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatBoundsLike/),  
        options?: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[FitBoundsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/FitBoundsOptions/)\>,  
        eventData?: object,  
    ): this[](#fitbounds-1)
    
    Pans and zooms the map to contain its visible area within the specified geographical bounds. This function will also reset the map's bearing to 0 if options.bearing is not specified.
    
    If `options.experimental_preload` is provided, tiles for the target view are fetched and cached before the animation begins.
    
    #### Parameters
    
    -   bounds: [LngLatBoundsLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatBoundsLike/)
    -   `Optional`options: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[FitBoundsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/FitBoundsOptions/)\>
    -   `Optional`eventData: object
    
    #### Returns this
    
    #### Remarks[](#remarks-4)
    
    **API Key Usage**: When `experimental_preload` is set, tile requests are issued for the destination viewport. These count against your MapTiler Cloud API key quota.
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[fitBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#fitbounds)
    

### fitScreenCoordinates[](#fitscreencoordinates)

-   fitScreenCoordinates(  
        p0: [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/),  
        p1: [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/),  
        bearing: number,  
        options?: [FitBoundsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/FitBoundsOptions/),  
        eventData?: any,  
    ): this[](#fitscreencoordinates-1)
    
    Pans, rotates and zooms the map to to fit the box made by points p0 and p1 once the map is rotated to the specified bearing. To zoom without rotating, pass in the current map bearing.
    
    Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend` and `rotate`.
    
    #### Parameters
    
    -   p0: [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/)
        
        First point on screen, in pixel coordinates
        
    -   p1: [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/)
        
        Second point on screen, in pixel coordinates
        
    -   bearing: number
        
        Desired map bearing at end of animation, in degrees
        
    -   `Optional`options: [FitBoundsOptions](https://docs.maptiler.com/sdk-js/api-reference/types/FitBoundsOptions/)
        
        Options object
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### Example[](#example-14)
    
    ```typescript
    let p0 = [220, 400];
    let p1 = [500, 900];
    map.fitScreenCoordinates(p0, p1, map.getBearing(), {
      padding: {top: 10, bottom:25, left: 15, right: 5}
    });
    ```
    
    #### See[](#see-3)
    
    Used by [BoxZoomHandler](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.BoxZoomHandler/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[fitScreenCoordinates](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#fitscreencoordinates)
    

### `Maptiler`fitToIpBounds[](#fittoipbounds)

-   fitToIpBounds(): Promise<void\>[](#fittoipbounds-1)
    
    #### Returns Promise<void\>
    

### `Maptiler`flyTo[](#flyto)

-   flyTo(options: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[FlyToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/FlyToOptions/)\>, eventData?: object): this[](#flyto-1)
    
    Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that evokes flight. The animation seamlessly incorporates zooming and panning to help the user maintain her bearings even after traversing a great distance.
    
    If `options.experimental_preload` is provided, tiles along the flight path are fetched and cached before the animation begins so they are ready when rendered.
    
    #### Parameters
    
    -   options: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[FlyToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/FlyToOptions/)\>
    -   `Optional`eventData: object
    
    #### Returns this
    
    #### Remarks[](#remarks-5)
    
    **API Key Usage**: When `experimental_preload` is set, tile requests are issued for positions sampled along the flight path. These count against your MapTiler Cloud API key quota.
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[flyTo](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#flyto)
    

### `Maptiler`forgetPersistedProjection[](#forgetpersistedprojection)

-   forgetPersistedProjection(): Map[](#forgetpersistedprojection-1)
    
    Forget the persisted projection - from both constructor option and result of any `map.setProjection(..., { persist: true })` calls.
    
    #### Returns Map
    

### getAnisotropicFilterPitch[](#getanisotropicfilterpitch)

-   getAnisotropicFilterPitch(): number[](#getanisotropicfilterpitch-1)
    
    Returns the map's anisotropic filter pitch. If the map is pitched beyond this threshold, anisotropic filtering will be applied to all raster layers.
    
    #### Returns number
    
    The anisotropicFilterPitch
    
    #### Example[](#example-15)
    
    ```typescript
    let anisotropicFilterPitch = map.getAnisotropicFilterPitch();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getAnisotropicFilterPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getanisotropicfilterpitch)
    

### getBearing[](#getbearing)

-   getBearing(): number[](#getbearing-1)
    
    Returns the map's current bearing. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up.
    
    #### Returns number
    
    The map's current bearing.
    
    #### See[](#see-4)
    
    [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/navigate-the-map-with-game-like-controls/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getBearing](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getbearing)
    

### getBounds[](#getbounds)

-   getBounds(): [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/)[](#getbounds-1)
    
    Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.
    
    #### Returns [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/)
    
    The geographical bounds of the map as [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/).
    
    #### Example[](#example-16)
    
    ```typescript
    let bounds = map.getBounds();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getbounds)
    

### `Maptiler`getCameraHash[](#getcamerahash)

-   getCameraHash(): string[](#getcamerahash-1)
    
    #### Returns string
    

### getCameraTargetElevation[](#getcameratargetelevation)

-   getCameraTargetElevation(): number[](#getcameratargetelevation-1)
    
    Returns the elevation for the point where the camera is looking. This value corresponds to: "meters above sea level" \* "exaggeration"
    
    #### Returns number
    
    The elevation.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getCameraTargetElevation](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getcameratargetelevation)
    

### getCanvas[](#getcanvas)

-   getCanvas(): [HTMLCanvasElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLCanvasElement/)[](#getcanvas-1)
    
    Returns the map's `<canvas>` element.
    
    #### Returns [HTMLCanvasElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLCanvasElement/)
    
    The map's `<canvas>` element.
    
    #### See[](#see-5)
    
    -   [Measure distances](https://maplibre.org/maplibre-gl-js/docs/examples/measure-distances/)
    -   [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)
    -   [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-symbol/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getCanvas](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getcanvas)
    

### getCanvasContainer[](#getcanvascontainer)

-   getCanvasContainer(): [HTMLElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLElement/)[](#getcanvascontainer-1)
    
    Returns the HTML element containing the map's `<canvas>` element.
    
    If you want to add non-GL overlays to the map, you should append them to this element.
    
    This is the element to which event bindings for map interactivity (such as panning and zooming) are attached. It will receive bubbled events from child elements such as the `<canvas>`, but not from map controls.
    
    #### Returns [HTMLElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLElement/)
    
    The container of the map's `<canvas>`.
    
    #### See[](#see-6)
    
    [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getCanvasContainer](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getcanvascontainer)
    

### getCenter[](#getcenter)

-   getCenter(): [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)[](#getcenter-1)
    
    Returns the map's geographical centerpoint.
    
    #### Returns [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
    
    The map's geographical centerpoint.
    
    #### Example[](#example-17)
    
    Return a LngLat object such as `{lng: 0, lat: 0}`
    
    ```typescript
    let center = map.getCenter();
    // access longitude and latitude values directly
    let {lng, lat} = map.getCenter();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getCenter](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getcenter)
    

### getCenterClampedToGround[](#getcenterclampedtoground)

-   getCenterClampedToGround(): boolean[](#getcenterclampedtoground-1)
    
    Returns the value of `centerClampedToGround`.
    
    If true, the elevation of the center point will automatically be set to the terrain elevation (or zero if terrain is not enabled). If false, the elevation of the center point will default to sea level and will not automatically update. Defaults to true. Needs to be set to false to keep the camera above ground when pitch > 90 degrees.
    
    #### Returns boolean
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getCenterClampedToGround](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getcenterclampedtoground)
    

### getCenterElevation[](#getcenterelevation)

-   getCenterElevation(): number[](#getcenterelevation-1)
    
    Returns the elevation of the map's center point.
    
    #### Returns number
    
    The elevation of the map's center point, in meters above sea level.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getCenterElevation](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getcenterelevation)
    

### getContainer[](#getcontainer)

-   getContainer(): [HTMLElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLElement/)[](#getcontainer-1)
    
    Returns the map's containing HTML element.
    
    #### Returns [HTMLElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLElement/)
    
    The map's container.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getContainer](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getcontainer)
    

### getFeatureState[](#getfeaturestate)

-   getFeatureState(feature: [FeatureIdentifier](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureIdentifier/)): any[](#getfeaturestate-1)
    
    Gets the `state` of a feature. A feature's `state` is a set of user-defined key-value pairs that are assigned to a feature at runtime. Features are identified by their `feature.id` attribute, which can be any number or string.
    
    !!! note To access the values in a feature's state object for the purposes of styling the feature, use the [`feature-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#feature-state).
    
    #### Parameters
    
    -   feature: [FeatureIdentifier](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureIdentifier/)
        
        Feature identifier. Feature objects returned from [Map.queryRenderedFeatures](#queryrenderedfeatures) or event handlers can be used as feature identifiers.
        
    
    #### Returns any
    
    The state of the feature: a set of key-value pairs that was assigned to the feature at runtime.
    
    #### Example[](#example-18)
    
    When the mouse moves over the `my-layer` layer, get the feature state for the feature under the mouse
    
    ```typescript
    map.on('mousemove', 'my-layer', (e) => {
      if (e.features.length > 0) {
        map.getFeatureState({
          source: 'my-source',
          sourceLayer: 'my-source-layer',
          id: e.features[0].id
        });
      }
    });
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getFeatureState](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getfeaturestate)
    

### getFilter[](#getfilter)

-   getFilter(layerId: string): void | [FilterSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/FilterSpecification/)[](#getfilter-1)
    
    Returns the filter applied to the specified style layer.
    
    #### Parameters
    
    -   layerId: string
        
        The ID of the style layer whose filter to get.
        
    
    #### Returns void | [FilterSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/FilterSpecification/)
    
    The layer's filter.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getFilter](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getfilter)
    

### getGlobalState[](#getglobalstate)

-   getGlobalState(): [Record](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Record/)<string, any\>[](#getglobalstate-1)
    
    Returns the global map state
    
    #### Returns [Record](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Record/)<string, any\>
    
    The map state object.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getGlobalState](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getglobalstate)
    

### getGlyphs[](#getglyphs)

-   getGlyphs(): string | null[](#getglyphs-1)
    
    Returns the value of the style's glyphs URL
    
    #### Returns string | null
    
    glyphs Style's glyphs url, or `null` if glyphs are unset.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getGlyphs](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getglyphs)
    

### `Maptiler`getHalo[](#gethalo)

-   getHalo(): [RadialGradientLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/RadialGradientLayer/) | undefined[](#gethalo-1)
    
    #### Returns [RadialGradientLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/RadialGradientLayer/) | undefined
    

### getImage[](#getimage)

-   getImage(id: string): [StyleImage](https://docs.maptiler.com/sdk-js/api-reference/types/StyleImage/)[](#getimage-1)
    
    Returns an image, specified by ID, currently available in the map. This includes both images from the style's original sprite and any images that have been added at runtime using [Map.addImage](#addimage).
    
    #### Parameters
    
    -   id: string
        
        The ID of the image.
        
    
    #### Returns [StyleImage](https://docs.maptiler.com/sdk-js/api-reference/types/StyleImage/)
    
    An image in the map with the specified ID.
    
    #### Example[](#example-19)
    
    ```typescript
    let coffeeShopIcon = map.getImage("coffee_cup");
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getImage](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getimage)
    

### getLayer[](#getlayer)

-   getLayer(id: string): [StyleLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/StyleLayer/) | undefined[](#getlayer-1)
    
    Returns the layer with the specified ID in the map's style.
    
    #### Parameters
    
    -   id: string
        
        The ID of the layer to get.
        
    
    #### Returns [StyleLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/StyleLayer/) | undefined
    
    The layer with the specified ID, or `undefined` if the ID corresponds to no existing layers.
    
    #### Example[](#example-20)
    
    ```typescript
    let stateDataLayer = map.getLayer('state-data');
    ```
    
    #### See[](#see-7)
    
    -   [Filter symbols by toggling a list](https://maplibre.org/maplibre-gl-js/docs/examples/filter-symbols-by-toggling-a-list/)
    -   [Filter symbols by text input](https://maplibre.org/maplibre-gl-js/docs/examples/filter-symbols-by-text-input/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getlayer)
    

### getLayersOrder[](#getlayersorder)

-   getLayersOrder(): string\[\][](#getlayersorder-1)
    
    Return the ids of all layers currently in the style, including custom layers, in order.
    
    #### Returns string\[\]
    
    ids of layers, in order
    
    #### Example[](#example-21)
    
    ```typescript
    const orderedLayerIds = map.getLayersOrder();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getLayersOrder](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getlayersorder)
    

### getLayoutProperty[](#getlayoutproperty)

-   getLayoutProperty(layerId: string, name: string): any[](#getlayoutproperty-1)
    
    Returns the value of a layout property in the specified style layer.
    
    #### Parameters
    
    -   layerId: string
        
        The ID of the layer to get the layout property from.
        
    -   name: string
        
        The name of the layout property to get.
        
    
    #### Returns any
    
    The value of the specified layout property.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getLayoutProperty](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getlayoutproperty)
    

### getLight[](#getlight)

-   getLight(): [LightSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/LightSpecification/)[](#getlight-1)
    
    Returns the value of the light object.
    
    #### Returns [LightSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/LightSpecification/)
    
    light Light properties of the style.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getLight](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getlight)
    

### `Maptiler`getMaptilerSessionId[](#getmaptilersessionid)

-   getMaptilerSessionId(): string[](#getmaptilersessionid-1)
    
    Get the MapTiler session ID. Convenient to dispatch to externaly built component that do not directly have access to the SDK configuration but do have access to a Map instance.
    
    #### Returns string
    

### getMaxBounds[](#getmaxbounds)

-   getMaxBounds(): [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/) | null[](#getmaxbounds-1)
    
    Returns the maximum geographical bounds the map is constrained to, or `null` if none set.
    
    #### Returns [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/) | null
    
    The map object.
    
    #### Example[](#example-22)
    
    ```typescript
    let maxBounds = map.getMaxBounds();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getMaxBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getmaxbounds)
    

### getMaxPitch[](#getmaxpitch)

-   getMaxPitch(): number[](#getmaxpitch-1)
    
    Returns the map's maximum allowable pitch.
    
    #### Returns number
    
    The maxPitch
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getMaxPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getmaxpitch)
    

### getMaxZoom[](#getmaxzoom)

-   getMaxZoom(): number[](#getmaxzoom-1)
    
    Returns the map's maximum allowable zoom level.
    
    #### Returns number
    
    The maxZoom
    
    #### Example[](#example-23)
    
    ```typescript
    let maxZoom = map.getMaxZoom();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getMaxZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getmaxzoom)
    

### getMinPitch[](#getminpitch)

-   getMinPitch(): number[](#getminpitch-1)
    
    Returns the map's minimum allowable pitch.
    
    #### Returns number
    
    The minPitch
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getMinPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getminpitch)
    

### getMinZoom[](#getminzoom)

-   getMinZoom(): number[](#getminzoom-1)
    
    Returns the map's minimum allowable zoom level.
    
    #### Returns number
    
    minZoom
    
    #### Example[](#example-24)
    
    ```typescript
    let minZoom = map.getMinZoom();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getMinZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getminzoom)
    

### getPadding[](#getpadding)

-   getPadding(): [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/)[](#getpadding-1)
    
    Returns the current padding applied around the map viewport.
    
    #### Returns [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/)
    
    The current padding around the map viewport.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getPadding](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getpadding)
    

### getPaintProperty[](#getpaintproperty)

-   getPaintProperty(layerId: string, name: string): unknown[](#getpaintproperty-1)
    
    Returns the value of a paint property in the specified style layer.
    
    #### Parameters
    
    -   layerId: string
        
        The ID of the layer to get the paint property from.
        
    -   name: string
        
        The name of a paint property to get.
        
    
    #### Returns unknown
    
    The value of the specified paint property.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getPaintProperty](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getpaintproperty)
    

### getPitch[](#getpitch)

-   getPitch(): number[](#getpitch-1)
    
    Returns the map's current pitch (tilt).
    
    #### Returns number
    
    The map's current pitch, measured in degrees away from the plane of the screen.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getpitch)
    

### getPixelRatio[](#getpixelratio)

-   getPixelRatio(): number[](#getpixelratio-1)
    
    Returns the map's pixel ratio. Note that the pixel ratio actually applied may be lower to respect maxCanvasSize.
    
    #### Returns number
    
    The pixel ratio.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getPixelRatio](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getpixelratio)
    

### `Maptiler`getPrimaryLanguage[](#getprimarylanguage)

-   getPrimaryLanguage(): [LanguageInfo](https://docs.maptiler.com/sdk-js/api-reference/types/LanguageInfo/)[](#getprimarylanguage-1)
    
    Get the primary language
    
    #### Returns [LanguageInfo](https://docs.maptiler.com/sdk-js/api-reference/types/LanguageInfo/)
    

### `Maptiler`getProjection[](#getprojection)

-   getProjection(): [ProjectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionSpecification/)[](#getprojection-1)
    
    Gets the [ProjectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionSpecification/).
    
    #### Returns [ProjectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionSpecification/)
    
    the projection specification.
    
    #### Example[](#example-25)
    
    ```typescript
    let projection = map.getProjection();
    ```
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getProjection](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getprojection)
    

### getRenderWorldCopies[](#getrenderworldcopies)

-   getRenderWorldCopies(): boolean[](#getrenderworldcopies-1)
    
    Returns the state of `renderWorldCopies`. If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
    
    -   When the map is zoomed out far enough that a single representation of the world does not fill the map's entire container, there will be blank space beyond 180 and -180 degrees longitude.
    -   Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the map and the other on the left edge of the map) at every zoom level.
    
    #### Returns boolean
    
    The renderWorldCopies
    
    #### Example[](#example-26)
    
    ```typescript
    let worldCopiesRendered = map.getRenderWorldCopies();
    ```
    
    #### See[](#see-8)
    
    [Render world copies](https://maplibre.org/maplibre-gl-js/docs/examples/render-world-copies/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getRenderWorldCopies](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getrenderworldcopies)
    

### getRoll[](#getroll)

-   getRoll(): number[](#getroll-1)
    
    Returns the map's current roll angle.
    
    #### Returns number
    
    The map's current roll, measured in degrees about the camera boresight.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getRoll](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getroll)
    

### `Maptiler`getSdkConfig[](#getsdkconfig)

-   getSdkConfig(): [SdkConfig](https://docs.maptiler.com/sdk-js/api-reference/classes/SdkConfig/)[](#getsdkconfig-1)
    
    Get the SDK config object. This is convenient to dispatch the SDK configuration to externally built layers that do not directly have access to the SDK configuration but do have access to a Map instance.
    
    #### Returns [SdkConfig](https://docs.maptiler.com/sdk-js/api-reference/classes/SdkConfig/)
    

### getSky[](#getsky)

-   getSky(): [SkySpecification](https://docs.maptiler.com/sdk-js/api-reference/types/SkySpecification/)[](#getsky-1)
    
    Returns the value of the style's sky.
    
    #### Returns [SkySpecification](https://docs.maptiler.com/sdk-js/api-reference/types/SkySpecification/)
    
    the sky properties of the style.
    
    #### Example[](#example-27)
    
    ```typescript
    map.getSky();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getSky](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getsky)
    

### getSource[](#getsource)

-   getSource<[TSource](#getsourcetsource) extends [Source](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Source/)\>(id: string): [TSource](#getsourcetsource) | undefined[](#getsource-1)
    
    Returns the source with the specified ID in the map's style.
    
    This method is often used to update a source using the instance members for the relevant source type as defined in classes that derive from [Source](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Source/). For example, setting the `data` for a GeoJSON source or updating the `url` and `coordinates` of an image source.
    
    #### Type Parameters
    
    -   TSource extends [Source](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Source/)
    
    #### Parameters
    
    -   id: string
        
        The ID of the source to get.
        
    
    #### Returns [TSource](#getsourcetsource) | undefined
    
    The style source with the specified ID or `undefined` if the ID corresponds to no existing sources. The shape of the object varies by source type. A list of options for each source type is available on the MapLibre Style Specification's [Sources](https://maplibre.org/maplibre-style-spec/sources/) page.
    
    #### Example[](#example-28)
    
    ```typescript
    let sourceObject = map.getSource('points');
    ```
    
    #### See[](#see-9)
    
    -   [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)
    -   [Animate a point](https://maplibre.org/maplibre-gl-js/docs/examples/animate-a-point/)
    -   [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/add-live-realtime-data/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getSource](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getsource)
    

### `Maptiler`getSpace[](#getspace)

-   getSpace(): [CubemapLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/CubemapLayer/) | undefined[](#getspace-1)
    
    #### Returns [CubemapLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/CubemapLayer/) | undefined
    

### getSprite[](#getsprite)

-   getSprite(): { id: string; url: string }\[\][](#getsprite-1)
    
    Returns the as-is value of the style's sprite.
    
    #### Returns { id: string; url: string }\[\]
    
    style's sprite list of id-url pairs
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getSprite](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getsprite)
    

### getStyle[](#getstyle)

-   getStyle(): [StyleSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecification/)[](#getstyle-1)
    
    Returns the map's MapLibre style object, a JSON object which can be used to recreate the map's style.
    
    #### Returns [StyleSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecification/)
    
    The map's style JSON object.
    
    #### Example[](#example-29)
    
    ```typescript
    let styleJson = map.getStyle();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getStyle](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getstyle)
    

### getTerrain[](#getterrain)

-   getTerrain(): [TerrainSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/TerrainSpecification/) | null[](#getterrain-1)
    
    Get the terrain-options if terrain is loaded
    
    #### Returns [TerrainSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/TerrainSpecification/) | null
    
    the TerrainSpecification passed to setTerrain
    
    #### Example[](#example-30)
    
    ```typescript
    map.getTerrain(); // { source: 'terrain' };
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getTerrain](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getterrain)
    

### `Maptiler`getTerrainExaggeration[](#getterrainexaggeration)

-   getTerrainExaggeration(): number[](#getterrainexaggeration-1)
    
    Get the exaggeration factor applied to the terrain
    
    #### Returns number
    

### getVerticalFieldOfView[](#getverticalfieldofview)

-   getVerticalFieldOfView(): number[](#getverticalfieldofview-1)
    
    Returns the map's current vertical field of view, in degrees.
    
    #### Returns number
    
    The map's current vertical field of view.
    
    #### Default Value[](#default-value-2)
    
    ```typescript
    36.87
    ```
    
    #### Example[](#example-31)
    
    ```typescript
    const verticalFieldOfView = map.getVerticalFieldOfView();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getVerticalFieldOfView](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getverticalfieldofview)
    

### getZoom[](#getzoom)

-   getZoom(): number[](#getzoom-1)
    
    Returns the map's current zoom level.
    
    #### Returns number
    
    The map's current zoom level.
    
    #### Example[](#example-32)
    
    ```typescript
    map.getZoom();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getzoom)
    

### getZoomSnap[](#getzoomsnap)

-   getZoomSnap(): number[](#getzoomsnap-1)
    
    Returns the map's current zoom snap level.
    
    #### Returns number
    
    The map's current zoom snap level.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[getZoomSnap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#getzoomsnap)
    

### hasControl[](#hascontrol)

-   hasControl(control: [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/)): boolean[](#hascontrol-1)
    
    Checks if a control exists on the map.
    
    #### Parameters
    
    -   control: [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/)
        
        The [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/) to check.
        
    
    #### Returns boolean
    
    true if map contains control.
    
    #### Example[](#example-33)
    
    ```typescript
    // Define a new navigation control.
    let navigation = new NavigationControl();
    // Add zoom and rotation controls to the map.
    map.addControl(navigation);
    // Check that the navigation control exists on the map.
    map.hasControl(navigation);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[hasControl](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#hascontrol)
    

### hasImage[](#hasimage)

-   hasImage(id: string): boolean[](#hasimage-1)
    
    Check whether or not an image with a specific ID exists in the style. This checks both images in the style's original sprite and any images that have been added at runtime using [Map.addImage](#addimage).
    
    An [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) will be fired if the image ID is missing.
    
    #### Parameters
    
    -   id: string
        
        The ID of the image.
        
    
    #### Returns boolean
    
    A Boolean indicating whether the image exists.
    
    #### Example[](#example-34)
    
    Check if an image with the ID 'cat' exists in the style's sprite.
    
    ```typescript
    let catIconExists = map.hasImage('cat');
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[hasImage](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#hasimage)
    

### `Maptiler`hasTerrain[](#hasterrain)

-   hasTerrain(): boolean[](#hasterrain-1)
    
    Know if terrian is enabled or not
    
    #### Returns boolean
    

### isEasing[](#iseasing)

-   isEasing(): boolean[](#iseasing-1)
    
    #### Returns boolean
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[isEasing](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#iseasing)
    

### `Maptiler`isGlobeProjection[](#isglobeprojection)

-   isGlobeProjection(): boolean[](#isglobeprojection-1)
    
    Returns whether a globe projection is currently being used
    
    #### Returns boolean
    

### `Maptiler`isLanguageUpdated[](#islanguageupdated)

-   isLanguageUpdated(): boolean[](#islanguageupdated-1)
    
    Returns `true` is the language was ever updated, meaning changed from what is delivered in the style. Returns `false` if language in use is the language from the style and has never been changed.
    
    #### Returns boolean
    

### isMoving[](#ismoving)

-   isMoving(): boolean[](#ismoving-1)
    
    Returns true if the map is panning, zooming, rotating, or pitching due to a camera animation or user gesture.
    
    #### Returns boolean
    
    true if the map is moving.
    
    #### Example[](#example-35)
    
    ```typescript
    let isMoving = map.isMoving();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[isMoving](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#ismoving)
    

### isRotating[](#isrotating)

-   isRotating(): boolean[](#isrotating-1)
    
    Returns true if the map is rotating due to a camera animation or user gesture.
    
    #### Returns boolean
    
    true if the map is rotating.
    
    #### Example[](#example-36)
    
    ```typescript
    map.isRotating();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[isRotating](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#isrotating)
    

### isSourceLoaded[](#issourceloaded)

-   isSourceLoaded(id: string): boolean[](#issourceloaded-1)
    
    Returns a Boolean indicating whether the source is loaded. Returns `true` if the source with the given ID in the map's style has no outstanding network requests, otherwise `false`.
    
    A [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) event will be fired if there is no source with the specified ID.
    
    #### Parameters
    
    -   id: string
        
        The ID of the source to be checked.
        
    
    #### Returns boolean
    
    A Boolean indicating whether the source is loaded.
    
    #### Example[](#example-37)
    
    ```typescript
    let sourceLoaded = map.isSourceLoaded('bathymetry-data');
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[isSourceLoaded](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#issourceloaded)
    

### isStyleLoaded[](#isstyleloaded)

-   isStyleLoaded(): boolean | void[](#isstyleloaded-1)
    
    Returns a Boolean indicating whether the map's style is fully loaded.
    
    #### Returns boolean | void
    
    A Boolean indicating whether the style is fully loaded.
    
    #### Example[](#example-38)
    
    ```typescript
    let styleLoadStatus = map.isStyleLoaded();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[isStyleLoaded](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#isstyleloaded)
    

### isZooming[](#iszooming)

-   isZooming(): boolean[](#iszooming-1)
    
    Returns true if the map is zooming due to a camera animation or user gesture.
    
    #### Returns boolean
    
    true if the map is zooming.
    
    #### Example[](#example-39)
    
    ```typescript
    let isZooming = map.isZooming();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[isZooming](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#iszooming)
    

### jumpTo[](#jumpto)

-   jumpTo(options: [JumpToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/JumpToOptions/), eventData?: any): this[](#jumpto-1)
    
    Changes any combination of center, zoom, bearing, pitch, and roll, without an animated transition. The map will retain its current values for any details not specified in `options`.
    
    Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`, `pitch`, `pitchend`, `rollstart`, `roll`, `rollend` and `rotate`.
    
    #### Parameters
    
    -   options: [JumpToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/JumpToOptions/)
        
        Options object
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### Example[](#example-40)
    
    ```typescript
    // jump to coordinates at current zoom
    map.jumpTo({center: [0, 0]});
    // jump with zoom, pitch, and bearing options
    map.jumpTo({
      center: [0, 0],
      zoom: 8,
      pitch: 45,
      bearing: 90
    });
    ```
    
    #### See[](#see-10)
    
    -   [Jump to a series of locations](https://maplibre.org/maplibre-gl-js/docs/examples/jump-to-a-series-of-locations/)
    -   [Update a feature in realtime](https://maplibre.org/maplibre-gl-js/docs/examples/update-a-feature-in-realtime/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[jumpTo](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#jumpto)
    

### listens[](#listens)

-   listens(type: string): boolean[](#listens-1)
    
    Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.
    
    #### Parameters
    
    -   type: string
        
        The event type
        
    
    #### Returns boolean
    
    `true` if there is at least one registered listener for specified event type, `false` otherwise
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[listens](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#listens)
    

### listImages[](#listimages)

-   listImages(): string\[\][](#listimages-1)
    
    Returns an Array of strings containing the IDs of all images currently available in the map. This includes both images from the style's original sprite and any images that have been added at runtime using [Map.addImage](#addimage).
    
    #### Returns string\[\]
    
    An Array of strings containing the names of all sprites/images currently available in the map.
    
    #### Example[](#example-41)
    
    ```typescript
    let allImages = map.listImages();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[listImages](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#listimages)
    

### loaded[](#loaded)

-   loaded(): boolean[](#loaded-1)
    
    Returns a Boolean indicating whether the map is fully loaded.
    
    Returns `false` if the style is not yet fully loaded, or if there has been a change to the sources or style that has not yet fully loaded.
    
    #### Returns boolean
    
    A Boolean indicating whether the map is fully loaded.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[loaded](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#loaded)
    

### loadImage[](#loadimage)

-   loadImage(  
        url: string,  
    ): Promise<[GetResourceResponse](https://docs.maptiler.com/sdk-js/api-reference/types/GetResourceResponse/)<[ImageBitmap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageBitmap/) | [HTMLImageElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLImageElement/)\>\>[](#loadimage-1)
    
    Load an image from an external URL to be used with [Map.addImage](#addimage). External domains must support [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS).
    
    #### Parameters
    
    -   url: string
        
        The URL of the image file. Image file must be in png, webp, or jpg format.
        
    
    #### Returns Promise<[GetResourceResponse](https://docs.maptiler.com/sdk-js/api-reference/types/GetResourceResponse/)<[ImageBitmap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageBitmap/) | [HTMLImageElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLImageElement/)\>\>
    
    a promise that is resolved when the image is loaded
    
    #### Example[](#example-42)
    
    Load an image from an external URL.
    
    ```typescript
    const response = await map.loadImage('https://picsum.photos/50/50');
    // Add the loaded image to the style's sprite with the ID 'photo'.
    map.addImage('photo', response.data);
    ```
    
    #### See[](#see-11)
    
    [Add an icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-an-icon-to-the-map/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[loadImage](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#loadimage)
    

### migrateProjection[](#migrateprojection)

-   migrateProjection(  
        newTransform: [ITransform](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ITransform/),  
        newCameraHelper: [ICameraHelper](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ICameraHelper/),  
    ): void[](#migrateprojection-1)
    
    #### Parameters
    
    -   newTransform: [ITransform](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ITransform/)
    -   newCameraHelper: [ICameraHelper](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ICameraHelper/)
    
    #### Returns void
    
    #### Internal[](#internal)
    
    Creates a new specialized transform instance from a projection instance and migrates to this new transform, carrying over all the properties of the old transform (center, pitch, etc.). When the style's projection is changed (or first set), this function should be called.
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[migrateProjection](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#migrateprojection)
    

### `Maptiler`moveLayer[](#movelayer)

-   moveLayer(id: string, beforeId?: string): this[](#movelayer-1)
    
    Moves a layer to a different z-position.
    
    #### Parameters
    
    -   id: string
        
        The ID of the layer to move.
        
    -   `Optional`beforeId: string
        
        The ID of an existing layer to insert the new layer before. When viewing the map, the `id` layer will appear beneath the `beforeId` layer. If `beforeId` is omitted, the layer will be appended to the end of the layers array and appear above all other layers on the map.
        
    
    #### Returns this
    
    `this`
    
    #### Example[](#example-43)
    
    Move a layer with ID 'polygon' before the layer with ID 'country-label'. The `polygon` layer will appear beneath the `country-label` layer on the map.
    
    ```typescript
    map.moveLayer('polygon', 'country-label');
    ```
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[moveLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#movelayer)
    

### off[](#off)

-   off<[T](#offt) extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\>(  
        type: [T](#offt),  
        layer: string,  
        listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#offt)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void,  
    ): this[](#off-1)
    
    Removes an event listener for events previously added with `{@link Map.on}`.
    
    #### Type Parameters
    
    -   T extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)
    
    #### Parameters
    
    -   type: [T](#offt)
        
        The event type previously used to install the listener.
        
    -   layer: string
        
        The layer ID or listener previously used to install the listener.
        
    -   listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#offt)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void
        
        The function previously installed as a listener.
        
    
    #### Returns this
    
    #### Event[](#event)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[off](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#off)
    
-   off<[T](#offt-1) extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\>(  
        type: [T](#offt-1),  
        layers: string\[\],  
        listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#offt-1)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void,  
    ): this[](#off-2)
    
    Overload of the `off` method that allows to remove an event created with multiple layers. Provide the same layer IDs as to `on` or `once`, when the listener was registered.
    
    #### Type Parameters
    
    -   T extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)
    
    #### Parameters
    
    -   type: [T](#offt-1)
        
        The type of the event.
        
    -   layers: string\[\]
        
        The layer IDs previously used to install the listener.
        
    -   listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#offt-1)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void
        
        The function previously installed as a listener.
        
    
    #### Returns this
    
    #### Event[](#event-1)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[off](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#off)
    
-   off<[T](#offt-2) extends keyof [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)\>(  
        type: [T](#offt-2),  
        listener: (ev: [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)\[[T](#offt-2)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void,  
    ): this[](#off-3)
    
    Overload of the `off` method that allows to remove an event created without specifying a layer.
    
    #### Type Parameters
    
    -   T extends keyof [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)
    
    #### Parameters
    
    -   type: [T](#offt-2)
        
        The type of the event.
        
    -   listener: (ev: [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)\[[T](#offt-2)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void
        
        The function previously installed as a listener.
        
    
    #### Returns this
    
    #### Event[](#event-2)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[off](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#off)
    
-   off(type: string, listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)): this[](#off-4)
    
    Overload of the `off` method that allows to remove an event created without specifying a layer.
    
    #### Parameters
    
    -   type: string
        
        The type of the event.
        
    -   listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)
        
        The function previously installed as a listener.
        
    
    #### Returns this
    
    #### Event[](#event-3)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[off](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#off)
    

### on[](#on)

-   on<[T](#ont) extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\>(  
        type: [T](#ont),  
        layer: string,  
        listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#ont)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void,  
    ): [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)[](#on-1)
    
    #### Type Parameters
    
    -   T extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)
    
    #### Parameters
    
    -   type: [T](#ont)
        
        The event type to listen for. Events compatible with the optional `layerId` parameter are triggered when the cursor enters a visible portion of the specified layer from outside that layer or outside the map canvas.
        
    -   layer: string
        
        The ID of a style layer or a listener if no ID is provided. Event will only be triggered if its location is within a visible feature in this layer. The event will have a `features` property containing an array of the matching features. If `layer` is not supplied, the event will not have a `features` property. Please note that many event types are not compatible with the optional `layer` parameter.
        
    -   listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#ont)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void
        
        The function to be called when the event is fired.
        
    
    #### Returns [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)
    
    #### Event[](#event-4)
    
    Adds a listener for events of a specified type, optionally limited to features in a specified style layer(s). See [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/) and [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/) for a full list of events and their description.
    
    | Event | Compatible with `layerId` |
    | --- | --- |
    | `mousedown` | yes |
    | `mouseup` | yes |
    | `mouseover` | yes |
    | `mouseout` | yes |
    | `mousemove` | yes |
    | `mouseenter` | yes (required) |
    | `mouseleave` | yes (required) |
    | `click` | yes |
    | `dblclick` | yes |
    | `contextmenu` | yes |
    | `touchstart` | yes |
    | `touchend` | yes |
    | `touchcancel` | yes |
    | `wheel` |  |
    | `resize` |  |
    | `remove` |  |
    | `touchmove` |  |
    | `movestart` |  |
    | `move` |  |
    | `moveend` |  |
    | `dragstart` |  |
    | `drag` |  |
    | `dragend` |  |
    | `zoomstart` |  |
    | `zoom` |  |
    | `zoomend` |  |
    | `rotatestart` |  |
    | `rotate` |  |
    | `rotateend` |  |
    | `pitchstart` |  |
    | `pitch` |  |
    | `pitchend` |  |
    | `boxzoomstart` |  |
    | `boxzoomend` |  |
    | `boxzoomcancel` |  |
    | `webglcontextlost` |  |
    | `webglcontextrestored` |  |
    | `load` |  |
    | `render` |  |
    | `idle` |  |
    | `error` |  |
    | `data` |  |
    | `styledata` |  |
    | `sourcedata` |  |
    | `dataloading` |  |
    | `styledataloading` |  |
    | `sourcedataloading` |  |
    | `styleimagemissing` |  |
    | `dataabort` |  |
    | `sourcedataabort` |  |
    
    #### Example[](#example-44)
    
    ```typescript
    // Set an event listener that will fire
    // when the map has finished loading
    map.on('load', () => {
      // Once the map has finished loading,
      // add a new layer
      map.addLayer({
        id: 'points-of-interest',
        source: {
          type: 'vector',
          url: 'https://maplibre.org/maplibre-style-spec/'
        },
        'source-layer': 'poi_label',
        type: 'circle',
        paint: {
          // MapLibre Style Specification paint properties
        },
        layout: {
          // MapLibre Style Specification layout properties
        }
      });
    });
    ```
    
    #### Example[](#example-45)
    
    ```typescript
    // Set an event listener that will fire
    // when a feature on the countries layer of the map is clicked
    map.on('click', 'countries', (e) => {
      new Popup()
        .setLngLat(e.lngLat)
        .setHTML(`Country name: ${e.features[0].properties.name}`)
        .addTo(map);
    });
    ```
    
    #### See[](#see-12)
    
    -   [Display popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)
    -   [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-symbol/)
    -   [Create a hover effect](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)
    -   [Create a draggable marker](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[on](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#on)
    
-   on<[T](#ont-1) extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\>(  
        type: [T](#ont-1),  
        layerIds: string\[\],  
        listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#ont-1)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void,  
    ): [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)[](#on-2)
    
    Overload of the `on` method that allows to listen to events specifying multiple layers.
    
    #### Type Parameters
    
    -   T extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)
    
    #### Parameters
    
    -   type: [T](#ont-1)
        
        The type of the event.
        
    -   layerIds: string\[\]
        
        The array of style layer IDs.
        
    -   listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#ont-1)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void
        
        The listener callback.
        
    
    #### Returns [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)
    
    #### Event[](#event-5)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[on](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#on)
    
-   on<[T](#ont-2) extends keyof [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)\>(  
        type: [T](#ont-2),  
        listener: (ev: [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)\[[T](#ont-2)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void,  
    ): [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)[](#on-3)
    
    Overload of the `on` method that allows to listen to events without specifying a layer.
    
    #### Type Parameters
    
    -   T extends keyof [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)
    
    #### Parameters
    
    -   type: [T](#ont-2)
        
        The type of the event.
        
    -   listener: (ev: [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)\[[T](#ont-2)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void
        
        The listener callback.
        
    
    #### Returns [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)
    
    #### Event[](#event-6)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[on](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#on)
    
-   on(type: string, listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)): [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)[](#on-4)
    
    Overload of the `on` method that allows to listen to events without specifying a layer.
    
    #### Parameters
    
    -   type: string
        
        The type of the event.
        
    -   listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)
        
        The listener callback.
        
    
    #### Returns [Subscription](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Subscription/)
    
    #### Event[](#event-7)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[on](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#on)
    

### once[](#once)

-   once<[T](#oncet) extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\>(  
        type: [T](#oncet),  
        layer: string,  
        listener?: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#oncet)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void,  
    ): Map | Promise<[MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#oncet)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)\>[](#once-1)
    
    Adds a listener that will be called only once to a specified event type, optionally limited to features in a specified style layer.
    
    #### Type Parameters
    
    -   T extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)
    
    #### Parameters
    
    -   type: [T](#oncet)
        
        The event type to listen for; one of `'mousedown'`, `'mouseup'`, `'click'`, `'dblclick'`, `'mousemove'`, `'mouseenter'`, `'mouseleave'`, `'mouseover'`, `'mouseout'`, `'contextmenu'`, `'touchstart'`, `'touchend'`, or `'touchcancel'`. `mouseenter` and `mouseover` events are triggered when the cursor enters a visible portion of the specified layer from outside that layer or outside the map canvas. `mouseleave` and `mouseout` events are triggered when the cursor leaves a visible portion of the specified layer, or leaves the map canvas.
        
    -   layer: string
        
        The ID of a style layer or a listener if no ID is provided. Only events whose location is within a visible feature in this layer will trigger the listener. The event will have a `features` property containing an array of the matching features.
        
    -   `Optional`listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#oncet)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void
        
        The function to be called when the event is fired.
        
    
    #### Returns Map | Promise<[MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#oncet)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)\>
    
    `this` if listener is provided, promise otherwise to allow easier usage of async/await
    
    #### Event[](#event-8)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[once](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#once)
    
-   once<[T](#oncet-1) extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\>(  
        type: [T](#oncet-1),  
        layerIds: string\[\],  
        listener?: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#oncet-1)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void,  
    ): Promise<any\> | Map[](#once-2)
    
    Overload of the `once` method that allows to listen to events specifying multiple layers.
    
    #### Type Parameters
    
    -   T extends keyof [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)
    
    #### Parameters
    
    -   type: [T](#oncet-1)
        
        The type of the event.
        
    -   layerIds: string\[\]
        
        The array of style layer IDs.
        
    -   `Optional`listener: (ev: [MapLayerEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapLayerEventType/)\[[T](#oncet-1)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void
        
        The listener callback.
        
    
    #### Returns Promise<any\> | Map
    
    #### Event[](#event-9)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[once](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#once)
    
-   once<[T](#oncet-2) extends keyof [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)\>(  
        type: [T](#oncet-2),  
        listener?: (ev: [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)\[[T](#oncet-2)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void,  
    ): Promise<any\> | Map[](#once-3)
    
    Overload of the `once` method that allows to listen to events without specifying a layer.
    
    #### Type Parameters
    
    -   T extends keyof [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)
    
    #### Parameters
    
    -   type: [T](#oncet-2)
        
        The type of the event.
        
    -   `Optional`listener: (ev: [MapEventType](https://docs.maptiler.com/sdk-js/api-reference/types/MapEventType/)\[[T](#oncet-2)\] & [Object](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Object/)) \=> void
        
        The listener callback.
        
    
    #### Returns Promise<any\> | Map
    
    #### Event[](#event-10)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[once](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#once)
    
-   once(type: string, listener?: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)): Promise<any\> | Map[](#once-4)
    
    Overload of the `once` method that allows to listen to events without specifying a layer.
    
    #### Parameters
    
    -   type: string
        
        The type of the event.
        
    -   `Optional`listener: [Listener](https://docs.maptiler.com/sdk-js/api-reference/types/Listener/)
        
        The listener callback.
        
    
    #### Returns Promise<any\> | Map
    
    #### Event[](#event-11)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[once](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#once)
    

### `Maptiler`onLoadAsync[](#onloadasync)

-   onLoadAsync(): Promise<Map\>[](#onloadasync-1)
    
    Awaits for _this_ Map instance to be "loaded" and returns a Promise to the Map. If _this_ Map instance is already loaded, the Promise is resolved directly, otherwise, it is resolved as a result of the "load" event.
    
    #### Returns Promise<Map\>
    

### `Maptiler`onLoadWithTerrainAsync[](#onloadwithterrainasync)

-   onLoadWithTerrainAsync(): Promise<Map\>[](#onloadwithterrainasync-1)
    
    Awaits for _this_ Map instance to be "loaded" as well as with terrain being non-null for the first time and returns a Promise to the Map. If _this_ Map instance is already loaded with terrain, the Promise is resolved directly, otherwise, it is resolved as a result of the "loadWithTerrain" event.
    
    #### Returns Promise<Map\>
    

### `Maptiler`onReadyAsync[](#onreadyasync)

-   onReadyAsync(): Promise<Map\>[](#onreadyasync-1)
    
    Awaits for _this_ Map instance to be "ready" and returns a Promise to the Map. If _this_ Map instance is already ready, the Promise is resolved directly, otherwise, it is resolved as a result of the "ready" event. A map instance is "ready" when all the controls that can be managed by the contructor are dealt with. This happens after the "load" event, due to the asynchronous nature of some built-in controls.
    
    #### Returns Promise<Map\>
    

### panBy[](#panby)

-   panBy(offset: [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/), options?: [EaseToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/EaseToOptions/), eventData?: any): this[](#panby-1)
    
    Pans the map by the specified offset.
    
    Triggers the following events: `movestart` and `moveend`.
    
    #### Parameters
    
    -   offset: [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/)
        
        `x` and `y` coordinates by which to pan the map.
        
    -   `Optional`options: [EaseToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/EaseToOptions/)
        
        Options object
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### See[](#see-13)
    
    [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/navigate-the-map-with-game-like-controls/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[panBy](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#panby)
    

### `Maptiler`panTo[](#panto)

-   panTo(  
        lnglat: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/),  
        options?: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/) & { pitch?: number }\>,  
        eventData?: object,  
    ): this[](#panto-1)
    
    Pans the map to the specified location with an animated transition.
    
    If `options.experimental_preload` is provided, tiles along the pan path are fetched and cached before the animation begins.
    
    #### Parameters
    
    -   lnglat: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/)
    -   `Optional`options: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/) & { pitch?: number }\>
    -   `Optional`eventData: object
    
    #### Returns this
    
    #### Remarks[](#remarks-6)
    
    **API Key Usage**: When `experimental_preload` is set, tile requests are issued for positions sampled along the pan path. These count against your MapTiler Cloud API key quota.
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[panTo](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#panto)
    

### project[](#project)

-   project(lnglat: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/)): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)[](#project-1)
    
    Returns a [Point](https://github.com/mapbox/point-geometry) representing pixel coordinates, relative to the map's `container`, that correspond to the specified geographical location.
    
    #### Parameters
    
    -   lnglat: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/)
        
        The geographical location to project.
        
    
    #### Returns [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    
    The [Point](https://github.com/mapbox/point-geometry) corresponding to `lnglat`, relative to the map's `container`.
    
    #### Example[](#example-46)
    
    ```typescript
    let coordinate = [-122.420679, 37.772537];
    let point = map.project(coordinate);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[project](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#project)
    

### queryRenderedFeatures[](#queryrenderedfeatures)

-   queryRenderedFeatures(  
        geometryOrOptions?:  
            | [QueryRenderedFeaturesOptions](https://docs.maptiler.com/sdk-js/api-reference/types/QueryRenderedFeaturesOptions/)  
            | [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/)  
            | \[[PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/), [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/)\],  
        options?: [QueryRenderedFeaturesOptions](https://docs.maptiler.com/sdk-js/api-reference/types/QueryRenderedFeaturesOptions/),  
    ): [MapGeoJSONFeature](https://docs.maptiler.com/sdk-js/api-reference/types/MapGeoJSONFeature/)\[\][](#queryrenderedfeatures-1)
    
    Returns an array of MapGeoJSONFeature objects representing visible features that satisfy the query parameters.
    
    #### Parameters
    
    -   `Optional`geometryOrOptions: [QueryRenderedFeaturesOptions](https://docs.maptiler.com/sdk-js/api-reference/types/QueryRenderedFeaturesOptions/) | [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/) | \[[PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/), [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/)\]
        
        (optional) The geometry of the query region in pixel points within the map viewport: either a single pixel point or a pair of top-left and bottom-right pixel points describing a bounding box. The origin of the pixel points is at the top-left of the map viewport. Omitting this parameter (i.e. calling [Map.queryRenderedFeatures](#queryrenderedfeatures) with zero arguments, or with only a `options` argument) is equivalent to passing a bounding box encompassing the entire map viewport. The geometryOrOptions can receive a [QueryRenderedFeaturesOptions](https://docs.maptiler.com/sdk-js/api-reference/types/QueryRenderedFeaturesOptions/) only to support a situation where the function receives only one parameter which is the options parameter.
        
    -   `Optional`options: [QueryRenderedFeaturesOptions](https://docs.maptiler.com/sdk-js/api-reference/types/QueryRenderedFeaturesOptions/)
        
        (optional) Options object.
        
    
    #### Returns [MapGeoJSONFeature](https://docs.maptiler.com/sdk-js/api-reference/types/MapGeoJSONFeature/)\[\]
    
    An array of MapGeoJSONFeature objects.
    
    The `properties` value of each returned feature object contains the properties of its source feature. For GeoJSON sources, only string and numeric property values are supported (i.e. `null`, `Array`, and `Object` values are not supported).
    
    Each feature includes top-level `layer`, `source`, and `sourceLayer` properties. The `layer` property is an object representing the style layer to which the feature belongs. Layout and paint properties in this object contain values which are fully evaluated for the given zoom level and feature.
    
    Only features that are currently rendered are included. Some features will **not** be included, like:
    
    -   Features from layers whose `visibility` property is `"none"`.
    -   Features from layers whose zoom range excludes the current zoom level.
    -   Symbol features that have been hidden due to text or icon collision.
    
    Features from all other layers are included, including features that may have no visible contribution to the rendered result; for example, because the layer's opacity or color alpha component is set to 0.
    
    The topmost rendered feature appears first in the returned array, and subsequent features are sorted by descending z-order. Features that are rendered multiple times (due to wrapping across the antemeridian at low zoom levels) are returned only once (though subject to the following caveat).
    
    Because features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple times in query results. For example, suppose there is a highway running through the bounding rectangle of a query. The results of the query will be those parts of the highway that lie within the map tiles covering the bounding rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple tiles due to tile buffering.
    
    #### Example[](#example-47)
    
    Find all features at a point
    
    ```typescript
    let features = map.queryRenderedFeatures(
      [20, 35],
      { layers: ['my-layer-name'] }
    );
    ```
    
    #### Example[](#example-48)
    
    Find all features within a static bounding box
    
    ```typescript
    let features = map.queryRenderedFeatures(
      [[10, 20], [30, 50]],
      { layers: ['my-layer-name'] }
    );
    ```
    
    #### Example[](#example-49)
    
    Find all features within a bounding box around a point
    
    ```typescript
    let width = 10;
    let height = 20;
    let features = map.queryRenderedFeatures([
      [point.x - width / 2, point.y - height / 2],
      [point.x + width / 2, point.y + height / 2]
    ], { layers: ['my-layer-name'] });
    ```
    
    #### Example[](#example-50)
    
    Query all rendered features from a single layer
    
    ```typescript
    let features = map.queryRenderedFeatures({ layers: ['my-layer-name'] });
    ```
    
    #### See[](#see-14)
    
    [Get features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/get-features-under-the-mouse-pointer/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[queryRenderedFeatures](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#queryrenderedfeatures)
    

### querySourceFeatures[](#querysourcefeatures)

-   querySourceFeatures(  
        sourceId: string,  
        parameters?: [QuerySourceFeatureOptions](https://docs.maptiler.com/sdk-js/api-reference/types/QuerySourceFeatureOptions/) | null,  
    ): [GeoJSONFeature](https://docs.maptiler.com/sdk-js/api-reference/classes/GeoJSONFeature/)\[\][](#querysourcefeatures-1)
    
    Returns an array of MapGeoJSONFeature objects representing features within the specified vector tile or GeoJSON source that satisfy the query parameters.
    
    #### Parameters
    
    -   sourceId: string
        
        The ID of the vector tile or GeoJSON source to query.
        
    -   `Optional`parameters: [QuerySourceFeatureOptions](https://docs.maptiler.com/sdk-js/api-reference/types/QuerySourceFeatureOptions/) | null
        
        The options object.
        
    
    #### Returns [GeoJSONFeature](https://docs.maptiler.com/sdk-js/api-reference/classes/GeoJSONFeature/)\[\]
    
    An array of MapGeoJSONFeature objects.
    
    In contrast to [Map.queryRenderedFeatures](#queryrenderedfeatures), this function returns all features matching the query parameters, whether or not they are rendered by the current style (i.e. visible). The domain of the query includes all currently-loaded vector tiles and GeoJSON source tiles: this function does not check tiles outside the currently visible viewport.
    
    Because features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple times in query results. For example, suppose there is a highway running through the bounding rectangle of a query. The results of the query will be those parts of the highway that lie within the map tiles covering the bounding rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple tiles due to tile buffering.
    
    #### Example[](#example-51)
    
    Find all features in one source layer in a vector source
    
    ```typescript
    let features = map.querySourceFeatures('your-source-id', {
      sourceLayer: 'your-source-layer'
    });
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[querySourceFeatures](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#querysourcefeatures)
    

### queryTerrainElevation[](#queryterrainelevation)

-   queryTerrainElevation(lngLatLike: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/)): number | null[](#queryterrainelevation-1)
    
    Gets the elevation at a given location, in meters above sea level. Returns null if terrain is not enabled. If terrain is enabled with some exaggeration value, the value returned here will be reflective of (multiplied by) that exaggeration value. This method should be used for proper positioning of custom 3d objects, as explained [here](https://maplibre.org/maplibre-gl-js/docs/examples/adding-3d-models-using-threejs-on-terrain/)
    
    #### Parameters
    
    -   lngLatLike: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/)
        
        \[x,y\] or LngLat coordinates of the location
        
    
    #### Returns number | null
    
    elevation in meters
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[queryTerrainElevation](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#queryterrainelevation)
    

### `Maptiler`recreate[](#recreate)

-   recreate(): void[](#recreate-1)
    
    Recreates the map instance with the same options. Useful for WebGL context loss.
    
    #### Returns void
    

### redraw[](#redraw)

-   redraw(): this[](#redraw-1)
    
    Force a synchronous redraw of the map.
    
    #### Returns this
    
    #### Example[](#example-52)
    
    ```typescript
    map.redraw();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[redraw](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#redraw)
    

### refreshTiles[](#refreshtiles)

-   refreshTiles(  
        sourceId: string,  
        tileIds?: { x: number; y: number; z: number }\[\],  
    ): void[](#refreshtiles-1)
    
    Triggers a reload of the selected tiles
    
    #### Parameters
    
    -   sourceId: string
        
        The ID of the source
        
    -   `Optional`tileIds: { x: number; y: number; z: number }\[\]
        
        An array of tile IDs to be reloaded. If not defined, all tiles will be reloaded.
        
    
    #### Returns void
    
    #### Example[](#example-53)
    
    ```typescript
    map.refreshTiles('satellite', [{x:1024, y: 1023, z: 11}, {x:1023, y: 1023, z: 11}]);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[refreshTiles](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#refreshtiles)
    

### remove[](#remove)

-   remove(): void[](#remove-1)
    
    Clean up and release all internal resources associated with this map.
    
    This includes DOM elements, event bindings, web workers, and WebGL resources.
    
    Use this method when you are done using the map and wish to ensure that it no longer consumes browser resources. Afterwards, you must not call any other methods on the map.
    
    #### Returns void
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[remove](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#remove)
    

### removeControl[](#removecontrol)

-   removeControl(control: [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/)): this[](#removecontrol-1)
    
    Removes the control from the map.
    
    An [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) will be fired if the control is invalid.
    
    #### Parameters
    
    -   control: [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/)
        
        The [IControl](https://docs.maptiler.com/sdk-js/api-reference/interfaces/IControl/) to remove.
        
    
    #### Returns this
    
    #### Example[](#example-54)
    
    ```typescript
    // Define a new navigation control.
    let navigation = new NavigationControl();
    // Add zoom and rotation controls to the map.
    map.addControl(navigation);
    // Remove zoom and rotation controls from the map.
    map.removeControl(navigation);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[removeControl](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#removecontrol)
    

### removeFeatureState[](#removefeaturestate)

-   removeFeatureState(target: [FeatureIdentifier](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureIdentifier/), key?: string): this[](#removefeaturestate-1)
    
    Removes the `state` of a feature, setting it back to the default behavior. If only a `target.source` is specified, it will remove the state for all features from that source. If `target.id` is also specified, it will remove all keys for that feature's state. If `key` is also specified, it removes only that key from that feature's state. Features are identified by their `feature.id` attribute, which can be any number or string.
    
    #### Parameters
    
    -   target: [FeatureIdentifier](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureIdentifier/)
        
        Identifier of where to remove state. It can be a source, a feature, or a specific key of feature. Feature objects returned from [Map.queryRenderedFeatures](#queryrenderedfeatures) or event handlers can be used as feature identifiers.
        
    -   `Optional`key: string
        
        (optional) The key in the feature state to reset.
        
    
    #### Returns this
    
    #### Example[](#example-55)
    
    Reset the entire state object for all features in the `my-source` source
    
    ```typescript
    map.removeFeatureState({
      source: 'my-source'
    });
    ```
    
    #### Example[](#example-56)
    
    When the mouse leaves the `my-layer` layer, reset the entire state object for the feature under the mouse
    
    ```typescript
    map.on('mouseleave', 'my-layer', (e) => {
      map.removeFeatureState({
        source: 'my-source',
        sourceLayer: 'my-source-layer',
        id: e.features[0].id
      });
    });
    ```
    
    #### Example[](#example-57)
    
    When the mouse leaves the `my-layer` layer, reset only the `hover` key-value pair in the state for the feature under the mouse
    
    ```typescript
    map.on('mouseleave', 'my-layer', (e) => {
      map.removeFeatureState({
        source: 'my-source',
        sourceLayer: 'my-source-layer',
        id: e.features[0].id
      }, 'hover');
    });
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[removeFeatureState](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#removefeaturestate)
    

### removeImage[](#removeimage)

-   removeImage(id: string): void[](#removeimage-1)
    
    Remove an image from a style. This can be an image from the style's original sprite or any images that have been added at runtime using [Map.addImage](#addimage).
    
    #### Parameters
    
    -   id: string
        
        The ID of the image.
        
    
    #### Returns void
    
    #### Example[](#example-58)
    
    ```typescript
    // If an image with the ID 'cat' exists in
    // the style's sprite, remove it.
    if (map.hasImage('cat')) map.removeImage('cat');
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[removeImage](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#removeimage)
    

### `Maptiler`removeLayer[](#removelayer)

-   removeLayer(id: string): this[](#removelayer-1)
    
    Removes the layer with the given ID from the map's style.
    
    An [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) will be fired if the image parameter is invald.
    
    #### Parameters
    
    -   id: string
        
        The ID of the layer to remove
        
    
    #### Returns this
    
    `this`
    
    #### Example[](#example-59)
    
    If a layer with ID 'state-data' exists, remove it.
    
    ```typescript
    if (map.getLayer('state-data')) map.removeLayer('state-data');
    ```
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[removeLayer](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#removelayer)
    

### removeSource[](#removesource)

-   removeSource(id: string): this[](#removesource-1)
    
    Removes a source from the map's style.
    
    #### Parameters
    
    -   id: string
        
        The ID of the source to remove.
        
    
    #### Returns this
    
    #### Example[](#example-60)
    
    ```typescript
    map.removeSource('bathymetry-data');
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[removeSource](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#removesource)
    

### removeSprite[](#removesprite)

-   removeSprite(id: string): this[](#removesprite-1)
    
    Removes the sprite from the map's style. Fires the `style` event.
    
    #### Parameters
    
    -   id: string
        
        The ID of the sprite to remove. If the sprite is declared as a single URL, the ID must be "default".
        
    
    #### Returns this
    
    #### Example[](#example-61)
    
    ```typescript
    map.removeSprite('sprite-two');
    map.removeSprite('default');
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[removeSprite](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#removesprite)
    

### resetNorth[](#resetnorth)

-   resetNorth(options?: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/), eventData?: any): this[](#resetnorth-1)
    
    Rotates the map so that north is up (0° bearing), with an animated transition.
    
    Triggers the following events: `movestart`, `moveend`, and `rotate`.
    
    #### Parameters
    
    -   `Optional`options: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/)
        
        Options object
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[resetNorth](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#resetnorth)
    

### resetNorthPitch[](#resetnorthpitch)

-   resetNorthPitch(options?: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/), eventData?: any): this[](#resetnorthpitch-1)
    
    Rotates and pitches the map so that north is up (0° bearing) and pitch and roll are 0°, with an animated transition.
    
    Triggers the following events: `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, `pitchend`, `rollstart`, `roll`, `rollend`, and `rotate`.
    
    #### Parameters
    
    -   `Optional`options: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/)
        
        Options object
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[resetNorthPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#resetnorthpitch)
    

### resize[](#resize)

-   resize(eventData?: any, constrainTransform?: boolean): this[](#resize-1)
    
    Resizes the map according to the dimensions of its `container` element.
    
    Checks if the map container size changed and updates the map if it has changed. This method must be called after the map's `container` is resized programmatically or when the map is shown after being initially hidden with CSS.
    
    Triggers the following events: `movestart`, `move`, `moveend`, and `resize`.
    
    #### Parameters
    
    -   `Optional`eventData: any
        
        Additional properties to be passed to `movestart`, `move`, `resize`, and `moveend` events that get triggered as a result of resize. This can be useful for differentiating the source of an event (for example, user-initiated or programmatically-triggered events).
        
    -   `Optional`constrainTransform: boolean
    
    #### Returns this
    
    #### Example[](#example-62)
    
    Resize the map when the map container is shown after being initially hidden with CSS.
    
    ```typescript
    let mapDiv = document.getElementById('map');
    if (mapDiv.style.visibility === true) map.resize();
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[resize](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#resize)
    

### rotateTo[](#rotateto)

-   rotateTo(bearing: number, options?: [EaseToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/EaseToOptions/), eventData?: any): this[](#rotateto-1)
    
    Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up.
    
    Triggers the following events: `movestart`, `moveend`, and `rotate`.
    
    #### Parameters
    
    -   bearing: number
        
        The desired bearing.
        
    -   `Optional`options: [EaseToOptions](https://docs.maptiler.com/sdk-js/api-reference/types/EaseToOptions/)
        
        Options object
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[rotateTo](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#rotateto)
    

### setAnisotropicFilterPitch[](#setanisotropicfilterpitch)

-   setAnisotropicFilterPitch(anisotropicFilterPitch?: number | null): this[](#setanisotropicfilterpitch-1)
    
    Sets the map's anisotropic filter pitch or reverts it to its default.
    
    A [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) event will be fired if anisotropicFilterPitch is out of bounds.
    
    #### Parameters
    
    -   `Optional`anisotropicFilterPitch: number | null
        
        The pitch above which to apply anisotropic filtering to the map's raster layers (0-180). If `null` or `undefined` is provided, the function reverts to the default pitch threshold (20).
        
    
    #### Returns this
    
    #### Example[](#example-63)
    
    ```typescript
    map.setAnisotropicFilterPitch(85);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setAnisotropicFilterPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setanisotropicfilterpitch)
    

### setBearing[](#setbearing)

-   setBearing(bearing: number, eventData?: any): this[](#setbearing-1)
    
    Sets the map's bearing (rotation). The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up.
    
    Equivalent to `jumpTo({bearing: bearing})`.
    
    Triggers the following events: `movestart`, `moveend`, and `rotate`.
    
    #### Parameters
    
    -   bearing: number
        
        The desired bearing.
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### Example[](#example-64)
    
    Rotate the map to 90 degrees
    
    ```typescript
    map.setBearing(90);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setBearing](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setbearing)
    

### setCenter[](#setcenter)

-   setCenter(center: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/), eventData?: any): this[](#setcenter-1)
    
    Sets the map's geographical centerpoint. Equivalent to `jumpTo({center: center})`.
    
    Triggers the following events: `movestart` and `moveend`.
    
    #### Parameters
    
    -   center: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/)
        
        The centerpoint to set.
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### Example[](#example-65)
    
    ```typescript
    map.setCenter([-74, 38]);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setCenter](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setcenter)
    

### setCenterClampedToGround[](#setcenterclampedtoground)

-   setCenterClampedToGround(centerClampedToGround: boolean): void[](#setcenterclampedtoground-1)
    
    Sets the value of `centerClampedToGround`.
    
    If true, the elevation of the center point will automatically be set to the terrain elevation (or zero if terrain is not enabled). If false, the elevation of the center point will default to sea level and will not automatically update. Defaults to true. Needs to be set to false to keep the camera above ground when pitch > 90 degrees.
    
    #### Parameters
    
    -   centerClampedToGround: boolean
    
    #### Returns void
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setCenterClampedToGround](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setcenterclampedtoground)
    

### setCenterElevation[](#setcenterelevation)

-   setCenterElevation(elevation: number, eventData?: any): this[](#setcenterelevation-1)
    
    Sets the elevation of the map's center point, in meters above sea level. Equivalent to `jumpTo({elevation: elevation})`.
    
    Triggers the following events: `movestart` and `moveend`.
    
    #### Parameters
    
    -   elevation: number
        
        The elevation to set, in meters above sea level.
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setCenterElevation](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setcenterelevation)
    

### setEventedParent[](#seteventedparent)

-   setEventedParent(parent?: [Evented](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Evented/) | null, data?: any): this[](#seteventedparent-1)
    
    Bubble all events fired by this instance of Evented to this parent instance of Evented.
    
    #### Parameters
    
    -   `Optional`parent: [Evented](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Evented/) | null
    -   `Optional`data: any
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setEventedParent](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#seteventedparent)
    

### setFeatureState[](#setfeaturestate)

-   setFeatureState(feature: [FeatureIdentifier](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureIdentifier/), state: any): this[](#setfeaturestate-1)
    
    Sets the `state` of a feature. A feature's `state` is a set of user-defined key-value pairs that are assigned to a feature at runtime. When using this method, the `state` object is merged with any existing key-value pairs in the feature's state. Features are identified by their `feature.id` attribute, which can be any number or string.
    
    This method can only be used with sources that have a `feature.id` attribute. The `feature.id` attribute can be defined in three ways:
    
    -   For vector or GeoJSON sources, including an `id` attribute in the original data file.
    -   For vector or GeoJSON sources, using the [`promoteId`](https://maplibre.org/maplibre-style-spec/sources/#promoteid) option at the time the source is defined.
    -   For GeoJSON sources, using the [`generateId`](https://maplibre.org/maplibre-style-spec/sources/#generateid) option to auto-assign an `id` based on the feature's index in the source data. If you change feature data using `map.getSource('some id').setData(..)`, you may need to re-apply state taking into account updated `id` values.
    
    !!! note You can use the [`feature-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#feature-state) to access the values in a feature's state object for the purposes of styling.
    
    #### Parameters
    
    -   feature: [FeatureIdentifier](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureIdentifier/)
        
        Feature identifier. Feature objects returned from [Map.queryRenderedFeatures](#queryrenderedfeatures) or event handlers can be used as feature identifiers.
        
    -   state: any
        
        A set of key-value pairs. The values should be valid JSON types.
        
    
    #### Returns this
    
    #### Example[](#example-66)
    
    ```typescript
    // When the mouse moves over the `my-layer` layer, update
    // the feature state for the feature under the mouse
    map.on('mousemove', 'my-layer', (e) => {
      if (e.features.length > 0) {
        map.setFeatureState({
          source: 'my-source',
          sourceLayer: 'my-source-layer',
          id: e.features[0].id,
        }, {
          hover: true
        });
      }
    });
    ```
    
    #### See[](#see-15)
    
    [Create a hover effect](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setFeatureState](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setfeaturestate)
    

### `Maptiler`setFilter[](#setfilter)

-   setFilter(  
        layerId: string,  
        filter?: [FilterSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/FilterSpecification/) | null,  
        options?: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/),  
    ): this[](#setfilter-1)
    
    Sets the filter for the specified style layer.
    
    Filters control which features a style layer renders from its source. Any feature for which the filter expression evaluates to `true` will be rendered on the map. Those that are false will be hidden.
    
    Use `setFilter` to show a subset of your source data.
    
    To clear the filter, pass `null` or `undefined` as the second parameter.
    
    #### Parameters
    
    -   layerId: string
    -   `Optional`filter: [FilterSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/FilterSpecification/) | null
    -   `Optional`options: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)
    
    #### Returns this
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setFilter](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setfilter)
    

### setGlobalStateProperty[](#setglobalstateproperty)

-   setGlobalStateProperty(propertyName: string, value: any): this[](#setglobalstateproperty-1)
    
    Sets a global state property that can be retrieved with the [`global-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#global-state). If the value is null, it resets the property to its default value defined in the [`state` style property](https://maplibre.org/maplibre-style-spec/root/#state).
    
    #### Parameters
    
    -   propertyName: string
        
        The name of the state property to set.
        
    -   value: any
        
        The value of the state property to set.
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setGlobalStateProperty](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setglobalstateproperty)
    

### `Maptiler`setGlyphs[](#setglyphs)

-   setGlyphs(glyphsUrl: string | null, options?: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)): this[](#setglyphs-1)
    
    Sets the value of the style's glyphs property.
    
    #### Parameters
    
    -   glyphsUrl: string | null
        
        Glyph URL to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/glyphs/).
        
    -   `Optional`options: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)
        
        Options object.
        
    
    #### Returns this
    
    `this`
    
    #### Example[](#example-67)
    
    ```typescript
    map.setGlyphs('https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf');
    ```
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setGlyphs](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setglyphs)
    

### `Maptiler`setHalo[](#sethalo)

-   setHalo(halo: [GradientDefinition](https://docs.maptiler.com/sdk-js/api-reference/types/GradientDefinition/)): void[](#sethalo-1)
    
    #### Parameters
    
    -   halo: [GradientDefinition](https://docs.maptiler.com/sdk-js/api-reference/types/GradientDefinition/)
    
    #### Returns void
    

### `Maptiler`setHaloAnimationActive[](#sethaloanimationactive)

-   setHaloAnimationActive(active: boolean): void[](#sethaloanimationactive-1)
    
    Sets whether the halo layer should be animated in and out.
    
    #### Parameters
    
    -   active: boolean
        
        Whether the animation should be active.
        
    
    #### Returns void
    

### `Maptiler`setLanguage[](#setlanguage)

-   setLanguage(language: string | [LanguageInfo](https://docs.maptiler.com/sdk-js/api-reference/types/LanguageInfo/)): void[](#setlanguage-1)
    
    Define the primary language of the map. Note that not all the languages shorthands provided are available.
    
    #### Parameters
    
    -   language: string | [LanguageInfo](https://docs.maptiler.com/sdk-js/api-reference/types/LanguageInfo/)
    
    #### Returns void
    

### `Maptiler`setLayerZoomRange[](#setlayerzoomrange)

-   setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this[](#setlayerzoomrange-1)
    
    Sets the zoom extent for the specified style layer. The zoom extent includes the [minimum zoom level](https://maplibre.org/maplibre-style-spec/layers/#minzoom) and [maximum zoom level](https://maplibre.org/maplibre-style-spec/layers/#maxzoom)) at which the layer will be rendered.
    
    Note: For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the minimum zoom level of the _source layer_ because the data does not exist at those zoom levels. If the minimum zoom level of the source layer is higher than the minimum zoom level defined in the style layer, the style layer will not be rendered at all zoom levels in the zoom range.
    
    #### Parameters
    
    -   layerId: string
    -   minzoom: number
    -   maxzoom: number
    
    #### Returns this
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setLayerZoomRange](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setlayerzoomrange)
    

### `Maptiler`setLayoutProperty[](#setlayoutproperty)

-   setLayoutProperty(  
        layerId: string,  
        name: string,  
        value: any,  
        options?: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/),  
    ): this[](#setlayoutproperty-1)
    
    Sets the value of a layout property in the specified style layer. Layout properties define how the layer is styled. Layout properties for layers of the same type are documented together. Layers of different types have different layout properties. See the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/) for the complete list of layout properties.
    
    #### Parameters
    
    -   layerId: string
        
        The ID of the layer to set the layout property in.
        
    -   name: string
        
        The name of the layout property to set.
        
    -   value: any
        
        The value of the layout property to set. Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
        
    -   `Optional`options: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)
        
        Options object.
        
    
    #### Returns this
    
    `this`
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setLayoutProperty](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setlayoutproperty)
    

### setLight[](#setlight)

-   setLight(light: [LightSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/LightSpecification/), options?: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)): this[](#setlight-1)
    
    Sets the any combination of light values.
    
    #### Parameters
    
    -   light: [LightSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/LightSpecification/)
        
        Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/light).
        
    -   `Optional`options: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)
        
        Options object.
        
    
    #### Returns this
    
    #### Example[](#example-68)
    
    ```typescript
    let layerVisibility = map.getLayoutProperty('my-layer', 'visibility');
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setLight](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setlight)
    

### setMaxBounds[](#setmaxbounds)

-   setMaxBounds(bounds?: [LngLatBoundsLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatBoundsLike/) | null): this[](#setmaxbounds-1)
    
    Sets or clears the map's geographical bounds.
    
    Pan and zoom operations are constrained within these bounds. If a pan or zoom is performed that would display regions outside these bounds, the map will instead display a position and zoom level as close as possible to the operation's request while still remaining within the bounds.
    
    #### Parameters
    
    -   `Optional`bounds: [LngLatBoundsLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatBoundsLike/) | null
        
        The maximum bounds to set. If `null` or `undefined` is provided, the function removes the map's maximum bounds.
        
    
    #### Returns this
    
    #### Example[](#example-69)
    
    Define bounds that conform to the `LngLatBoundsLike` object as set the max bounds.
    
    ```typescript
    let bounds = [
      [-74.04728, 40.68392], // [west, south]
      [-73.91058, 40.87764]  // [east, north]
    ];
    map.setMaxBounds(bounds);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setMaxBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setmaxbounds)
    

### setMaxPitch[](#setmaxpitch)

-   setMaxPitch(maxPitch?: number | null): this[](#setmaxpitch-1)
    
    Sets or clears the map's maximum pitch. If the map's current pitch is higher than the new maximum, the map will pitch to the new maximum and trigger the following events: `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, and `pitchend`.
    
    A [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) event will be fired if maxPitch is out of bounds.
    
    #### Parameters
    
    -   `Optional`maxPitch: number | null
        
        The maximum pitch to set (0-180). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project. If `null` or `undefined` is provided, the function removes the current maximum pitch (sets it to 60).
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setMaxPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setmaxpitch)
    

### setMaxZoom[](#setmaxzoom)

-   setMaxZoom(maxZoom?: number | null): this[](#setmaxzoom-1)
    
    Sets or clears the map's maximum zoom level. If the map's current zoom level is higher than the new maximum, the map will zoom to the new maximum and trigger the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
    
    A [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) event will be fired if minZoom is out of bounds.
    
    #### Parameters
    
    -   `Optional`maxZoom: number | null
        
        The maximum zoom level to set. If `null` or `undefined` is provided, the function removes the current maximum zoom (sets it to 22).
        
    
    #### Returns this
    
    #### Example[](#example-70)
    
    ```typescript
    map.setMaxZoom(18.75);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setMaxZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setmaxzoom)
    

### setMinPitch[](#setminpitch)

-   setMinPitch(minPitch?: number | null): this[](#setminpitch-1)
    
    Sets or clears the map's minimum pitch. If the map's current pitch is lower than the new minimum, the map will pitch to the new minimum and trigger the following events: `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, and `pitchend`.
    
    A [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) event will be fired if minPitch is out of bounds.
    
    #### Parameters
    
    -   `Optional`minPitch: number | null
        
        The minimum pitch to set (0-180). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project. If `null` or `undefined` is provided, the function removes the current minimum pitch (i.e. sets it to 0).
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setMinPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setminpitch)
    

### setMinZoom[](#setminzoom)

-   setMinZoom(minZoom?: number | null): this[](#setminzoom-1)
    
    Sets or clears the map's minimum zoom level. If the map's current zoom level is lower than the new minimum, the map will zoom to the new minimum and trigger the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
    
    It is not always possible to zoom out and reach the set `minZoom`. Other factors such as map height may restrict zooming. For example, if the map is 512px tall it will not be possible to zoom below zoom 0 no matter what the `minZoom` is set to.
    
    A [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) event will be fired if minZoom is out of bounds.
    
    #### Parameters
    
    -   `Optional`minZoom: number | null
        
        The minimum zoom level to set (-2 - 24). If `null` or `undefined` is provided, the function removes the current minimum zoom (i.e. sets it to -2).
        
    
    #### Returns this
    
    #### Example[](#example-71)
    
    ```typescript
    map.setMinZoom(12.25);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setMinZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setminzoom)
    

### setPadding[](#setpadding)

-   setPadding(padding: [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/), eventData?: any): this[](#setpadding-1)
    
    Sets the padding in pixels around the viewport.
    
    Equivalent to `jumpTo({padding: padding})`.
    
    Triggers the following events: `movestart` and `moveend`.
    
    #### Parameters
    
    -   padding: [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/)
        
        The desired padding.
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### Example[](#example-72)
    
    Sets a left padding of 300px, and a top padding of 50px
    
    ```typescript
    map.setPadding({ left: 300, top: 50 });
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setPadding](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setpadding)
    

### `Maptiler`setPaintProperty[](#setpaintproperty)

-   setPaintProperty(  
        layerId: string,  
        name: string,  
        value: any,  
        options?: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/),  
    ): this[](#setpaintproperty-1)
    
    Sets the value of a paint property in the specified style layer.
    
    #### Parameters
    
    -   layerId: string
        
        The ID of the layer to set the paint property in.
        
    -   name: string
        
        The name of the paint property to set.
        
    -   value: any
        
        The value of the paint property to set. Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
        
    -   `Optional`options: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)
        
        Options object.
        
    
    #### Returns this
    
    `this`
    
    #### Example[](#example-73)
    
    ```typescript
    map.setPaintProperty('my-layer', 'fill-color', '#faafee');
    ```
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setPaintProperty](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setpaintproperty)
    

### setPitch[](#setpitch)

-   setPitch(pitch: number, eventData?: any): this[](#setpitch-1)
    
    Sets the map's pitch (tilt). Equivalent to `jumpTo({pitch: pitch})`.
    
    Triggers the following events: `movestart`, `moveend`, `pitchstart`, and `pitchend`.
    
    #### Parameters
    
    -   pitch: number
        
        The pitch to set, measured in degrees away from the plane of the screen (0-60).
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setPitch](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setpitch)
    

### setPixelRatio[](#setpixelratio)

-   setPixelRatio(pixelRatio: number): void[](#setpixelratio-1)
    
    Sets the map's pixel ratio. This allows to override `devicePixelRatio`. After this call, the canvas' `width` attribute will be `container.clientWidth * pixelRatio` and its height attribute will be `container.clientHeight * pixelRatio`. Set this to null to disable `devicePixelRatio` override. Note that the pixel ratio actually applied may be lower to respect maxCanvasSize.
    
    #### Parameters
    
    -   pixelRatio: number
        
        The pixel ratio.
        
    
    #### Returns void
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setPixelRatio](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setpixelratio)
    

### `Maptiler`setProjection[](#setprojection)

-   setProjection(  
        projection: [NonNullable](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.NonNullable/)<[ProjectionTypes](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionTypes/)\>,  
        options?: [ProjectionChangeOptions](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ProjectionChangeOptions/),  
    ): this[](#setprojection-1)
    
    Sets the projection to one of [`ProjectionTypes`](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionTypes/).
    
    #### Parameters
    
    -   projection: [NonNullable](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.NonNullable/)<[ProjectionTypes](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionTypes/)\>
        
        the projection type to set
        
    -   `Optional`options: [ProjectionChangeOptions](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ProjectionChangeOptions/)
        
        configure behaviour of the projection change
        
    
    #### Returns this
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setProjection](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setprojection)
    
-   setProjection(  
        projection: { type: [NonNullable](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.NonNullable/)<[ProjectionTypes](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionTypes/)\> },  
        options?: [ProjectionChangeOptions](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ProjectionChangeOptions/),  
    ): this[](#setprojection-2)
    
    Sets the projection to one of [`ProjectionTypes`](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionTypes/).
    
    #### Parameters
    
    -   projection: { type: [NonNullable](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.NonNullable/)<[ProjectionTypes](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionTypes/)\> }
        
        the projection type to set, wrapped in [ProjectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionSpecification/)
        
    -   `Optional`options: [ProjectionChangeOptions](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ProjectionChangeOptions/)
        
        configure behaviour of the projection change
        
    
    #### Returns this
    
    Overrides maplibregl.Map.setProjection
    
-   setProjection(projection: [ProjectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionSpecification/)): this[](#setprojection-3)
    
    Sets the projection to a [`ProjectionSpecification`](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionSpecification/).
    
    #### Parameters
    
    -   projection: [ProjectionSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionSpecification/)
        
        the projection specification to set
        
    
    #### Returns this
    
    Overrides maplibregl.Map.setProjection
    

### setRenderWorldCopies[](#setrenderworldcopies)

-   setRenderWorldCopies(renderWorldCopies?: boolean | null): this[](#setrenderworldcopies-1)
    
    Sets the state of `renderWorldCopies`.
    
    #### Parameters
    
    -   `Optional`renderWorldCopies: boolean | null
        
        If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
        
        -   When the map is zoomed out far enough that a single representation of the world does not fill the map's entire container, there will be blank space beyond 180 and -180 degrees longitude.
        -   Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the map and the other on the left edge of the map) at every zoom level.
        
        `undefined` is treated as `true`, `null` is treated as `false`.
        
    
    #### Returns this
    
    #### Example[](#example-74)
    
    ```typescript
    map.setRenderWorldCopies(true);
    ```
    
    #### See[](#see-16)
    
    [Render world copies](https://maplibre.org/maplibre-gl-js/docs/examples/render-world-copies/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setRenderWorldCopies](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setrenderworldcopies)
    

### setRoll[](#setroll)

-   setRoll(roll: number, eventData?: any): this[](#setroll-1)
    
    Sets the map's roll angle. Equivalent to `jumpTo({roll: roll})`.
    
    Triggers the following events: `movestart`, `moveend`, `rollstart`, and `rollend`.
    
    #### Parameters
    
    -   roll: number
        
        The roll to set, measured in degrees about the camera boresight
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setRoll](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setroll)
    

### setSky[](#setsky)

-   setSky(sky: [SkySpecification](https://docs.maptiler.com/sdk-js/api-reference/types/SkySpecification/), options?: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)): this[](#setsky-1)
    
    Sets the value of style's sky properties.
    
    #### Parameters
    
    -   sky: [SkySpecification](https://docs.maptiler.com/sdk-js/api-reference/types/SkySpecification/)
        
        Sky properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/sky/).
        
    -   `Optional`options: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)
        
        Options object.
        
    
    #### Returns this
    
    #### Example[](#example-75)
    
    ```typescript
    map.setSky({'atmosphere-blend': 1.0});
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setSky](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setsky)
    

### setSourceTileLodParams[](#setsourcetilelodparams)

-   setSourceTileLodParams(  
        maxZoomLevelsOnScreen: number,  
        tileCountMaxMinRatio: number,  
        sourceId?: string,  
    ): this[](#setsourcetilelodparams-1)
    
    Change the tile Level of Detail behavior of the specified source. These parameters have no effect when pitch == 0, and the largest effect when the horizon is visible on screen.
    
    #### Parameters
    
    -   maxZoomLevelsOnScreen: number
        
        The maximum number of distinct zoom levels allowed on screen at a time. There will generally be fewer zoom levels on the screen, the maximum can only be reached when the horizon is at the top of the screen. Increasing the maximum number of zoom levels causes the zoom level to decay faster toward the horizon.
        
    -   tileCountMaxMinRatio: number
        
        The ratio of the maximum number of tiles loaded (at high pitch) to the minimum number of tiles loaded. Increasing this ratio allows more tiles to be loaded at high pitch angles. If the ratio would otherwise be exceeded, the zoom level is reduced uniformly to keep the number of tiles within the limit.
        
    -   `Optional`sourceId: string
        
        The ID of the source to set tile LOD parameters for. All sources will be updated if unspecified. If `sourceId` is specified but a corresponding source does not exist, an error is thrown.
        
    
    #### Returns this
    
    #### Example[](#example-76)
    
    ```typescript
    map.setSourceTileLodParams(4.0, 3.0, 'terrain');
    ```
    
    #### See[](#see-17)
    
    [Modify Level of Detail behavior](https://maplibre.org/maplibre-gl-js/docs/examples/level-of-detail-control/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setSourceTileLodParams](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setsourcetilelodparams)
    

### `Maptiler`setSpace[](#setspace)

-   setSpace(space: boolean | [CubemapDefinition](https://docs.maptiler.com/sdk-js/api-reference/types/CubemapDefinition/), updateOptions?: boolean): void[](#setspace-1)
    
    Sets the space for the map.
    
    #### Parameters
    
    -   space: boolean | [CubemapDefinition](https://docs.maptiler.com/sdk-js/api-reference/types/CubemapDefinition/)
        
        the `CubemapDefinition` options to set.
        
    -   updateOptions: boolean = true
    
    #### Returns void
    
    #### Remarks[](#remarks-7)
    
    This method, at present, \*\* overwrites \*\* the current config. If an option is not set it will internally revert to the default option unless explicitly set when calling.
    

### `Maptiler`setSpaceAnimationActive[](#setspaceanimationactive)

-   setSpaceAnimationActive(active: boolean): void[](#setspaceanimationactive-1)
    
    Sets whether the space layer should be animated in and out.
    
    #### Parameters
    
    -   active: boolean
        
        Whether the animation should be active.
        
    
    #### Returns void
    

### setSprite[](#setsprite)

-   setSprite(spriteUrl: string | null, options?: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)): this[](#setsprite-1)
    
    Sets the value of the style's sprite property.
    
    #### Parameters
    
    -   spriteUrl: string | null
        
        Sprite URL to set.
        
    -   `Optional`options: [StyleSetterOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSetterOptions/)
        
        Options object.
        
    
    #### Returns this
    
    #### Example[](#example-77)
    
    ```typescript
    map.setSprite('YOUR_SPRITE_URL');
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setSprite](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setsprite)
    

### `Maptiler`setStyle[](#setstyle)

-   setStyle(  
        style:  
            | string  
            | [StyleSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecification/)  
            | [ReferenceMapStyle](https://docs.maptiler.com/sdk-js/api-reference/classes/ReferenceMapStyle/)  
            | [MapStyleVariant](https://docs.maptiler.com/sdk-js/api-reference/classes/MapStyleVariant/)  
            | [StyleSpecificationWithMetaData](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecificationWithMetaData/)  
            | null,  
        options?: [StyleSwapOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSwapOptions/) & [StyleOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleOptions/),  
    ): this[](#setstyle-1)
    
    Update the style of the map. Can be:
    
    -   a full style URL (possibly with API key)
    -   a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
    -   a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
    
    #### Parameters
    
    -   style:  
            | string  
            | [StyleSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecification/)  
            | [ReferenceMapStyle](https://docs.maptiler.com/sdk-js/api-reference/classes/ReferenceMapStyle/)  
            | [MapStyleVariant](https://docs.maptiler.com/sdk-js/api-reference/classes/MapStyleVariant/)  
            | [StyleSpecificationWithMetaData](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecificationWithMetaData/)  
            | null
    -   `Optional`options: [StyleSwapOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSwapOptions/) & [StyleOptions](https://docs.maptiler.com/sdk-js/api-reference/types/StyleOptions/)
    
    #### Returns this
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setStyle](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setstyle)
    

### setTerrain[](#setterrain)

-   setTerrain(options: [TerrainSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/TerrainSpecification/) | null): this[](#setterrain-1)
    
    Loads a 3D terrain mesh, based on a "raster-dem" source.
    
    Triggers the `terrain` event.
    
    #### Parameters
    
    -   options: [TerrainSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/TerrainSpecification/) | null
        
        Options object.
        
    
    #### Returns this
    
    #### Example[](#example-78)
    
    ```typescript
    map.setTerrain({ source: 'terrain' });
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setTerrain](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setterrain)
    

### `Maptiler`setTerrainAnimationDuration[](#setterrainanimationduration)

-   setTerrainAnimationDuration(d: number): void[](#setterrainanimationduration-1)
    
    Set the duration (millisec) of the terrain animation for growing or flattening. Must be positive. (Built-in default: `1000` milliseconds)
    
    #### Parameters
    
    -   d: number
    
    #### Returns void
    

### `Maptiler`setTerrainExaggeration[](#setterrainexaggeration)

-   setTerrainExaggeration(exaggeration: number, animate?: boolean): void[](#setterrainexaggeration-1)
    
    Sets the 3D terrain exageration factor. If the terrain was not enabled prior to the call of this method, the method `.enableTerrain()` will be called. If `animate` is `true`, the terrain transformation will be animated in the span of 1 second. If `animate` is `false`, no animated transition to the newly defined exaggeration.
    
    #### Parameters
    
    -   exaggeration: number
    -   animate: boolean = true
    
    #### Returns void
    

### setTransformConstrain[](#settransformconstrain)

-   setTransformConstrain(constrain?: [TransformConstrainFunction](https://docs.maptiler.com/sdk-js/api-reference/types/TransformConstrainFunction/) | null): this[](#settransformconstrain-1)
    
    Sets or clears the callback overriding how the map constrains the viewport's lnglat and zoom to respect the longitude and latitude bounds.
    
    #### Parameters
    
    -   `Optional`constrain: [TransformConstrainFunction](https://docs.maptiler.com/sdk-js/api-reference/types/TransformConstrainFunction/) | null
        
        A [TransformConstrainFunction](https://docs.maptiler.com/sdk-js/api-reference/types/TransformConstrainFunction/) callback defining how the viewport should respect the bounds.
        
        `null` clears the callback and reverts the constrain to the map transform's default constrain function.
        
    
    #### Returns this
    
    #### Example[](#example-79)
    
    ```typescript
    function customTransformConstrain(lngLat, zoom) {
      return {center: lngLat, zoom: zoom ?? 0};
    };
    map.setTransformConstrain(customTransformConstrain);
    ```
    
    #### See[](#see-18)
    
    [Customize the map transform constrain](https://maplibre.org/maplibre-gl-js/docs/examples/customize-the-map-transform-constrain/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setTransformConstrain](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#settransformconstrain)
    

### `Maptiler`setTransformRequest[](#settransformrequest)

-   setTransformRequest(transformRequest: [RequestTransformFunction](https://docs.maptiler.com/sdk-js/api-reference/types/RequestTransformFunction/)): this[](#settransformrequest-1)
    
    Updates the requestManager's transform request with a new function.
    
    #### Parameters
    
    -   transformRequest: [RequestTransformFunction](https://docs.maptiler.com/sdk-js/api-reference/types/RequestTransformFunction/)
        
        A callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests. Expected to return an object with a `url` property and optionally `headers` and `credentials` properties
        
    
    #### Returns this
    
    `this`
    
    #### Example[](#example-80)
    
    ```typescript
    map.setTransformRequest((url: string, resourceType: string) => {});
    ```
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setTransformRequest](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#settransformrequest)
    

### setVerticalFieldOfView[](#setverticalfieldofview)

-   setVerticalFieldOfView(fov: number, eventData?: any): this[](#setverticalfieldofview-1)
    
    Sets the map's vertical field of view, in degrees.
    
    Triggers the following events: `movestart`, `move`, and `moveend`.
    
    #### Parameters
    
    -   fov: number
        
        The vertical field of view to set, in degrees (0-180).
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### Default Value[](#default-value-3)
    
    ```typescript
    36.87
    ```
    
    #### Example[](#example-81)
    
    Change vertical field of view to 30 degrees
    
    ```typescript
    map.setVerticalFieldOfView(30);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setVerticalFieldOfView](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setverticalfieldofview)
    

### setZoom[](#setzoom)

-   setZoom(zoom: number, eventData?: any): this[](#setzoom-1)
    
    Sets the map's zoom level. Equivalent to `jumpTo({zoom: zoom})`.
    
    Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
    
    #### Parameters
    
    -   zoom: number
        
        The zoom level to set (0-20).
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### Example[](#example-82)
    
    Zoom to the zoom level 5 without an animated transition
    
    ```typescript
    map.setZoom(5);
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setZoom](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setzoom)
    

### setZoomSnap[](#setzoomsnap)

-   setZoomSnap(snap: number): this[](#setzoomsnap-1)
    
    Sets the map's zoom snap level.
    
    #### Parameters
    
    -   snap: number
        
        The zoom snap level to set.
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[setZoomSnap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#setzoomsnap)
    

### snapToNorth[](#snaptonorth)

-   snapToNorth(options?: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/), eventData?: any): this[](#snaptonorth-1)
    
    Snaps the map so that north is up (0° bearing), if the current bearing is close enough to it (i.e. within the `bearingSnap` threshold).
    
    Triggers the following events: `movestart`, `moveend`, and `rotate`.
    
    #### Parameters
    
    -   `Optional`options: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/)
        
        Options object
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[snapToNorth](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#snaptonorth)
    

### stop[](#stop)

-   stop(): this[](#stop-1)
    
    Stops any animated transition underway.
    
    #### Returns this
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[stop](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#stop)
    

### triggerRepaint[](#triggerrepaint)

-   triggerRepaint(): void[](#triggerrepaint-1)
    
    Trigger the rendering of a single frame. Use this method with custom layers to repaint the map when the layer changes. Calling this multiple times before the next frame is rendered will still result in only a single frame being rendered.
    
    #### Returns void
    
    #### Example[](#example-83)
    
    ```typescript
    map.triggerRepaint();
    ```
    
    #### See[](#see-19)
    
    -   [Add a 3D model](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-3d-model-using-threejs/)
    -   [Add an animated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-an-animated-icon-to-the-map/)
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[triggerRepaint](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#triggerrepaint)
    

### unproject[](#unproject)

-   unproject(point: [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/)): [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)[](#unproject-1)
    
    Returns a [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/) representing geographical coordinates that correspond to the specified pixel coordinates.
    
    #### Parameters
    
    -   point: [PointLike](https://docs.maptiler.com/sdk-js/api-reference/types/PointLike/)
        
        The pixel coordinates to unproject.
        
    
    #### Returns [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
    
    The [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/) corresponding to `point`.
    
    #### Example[](#example-84)
    
    ```typescript
    map.on('click', (e) => {
      // When the map is clicked, get the geographic coordinate.
      let coordinate = map.unproject(e.point);
    });
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[unproject](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#unproject)
    

### updateImage[](#updateimage)

-   updateImage(  
        id: string,  
        image:  
            | [ImageBitmap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageBitmap/)  
            | [StyleImageInterface](https://docs.maptiler.com/sdk-js/api-reference/interfaces/StyleImageInterface/)  
            | [ImageData](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageData/)  
            | [HTMLImageElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLImageElement/)  
            | {  
                data: Uint8Array<[ArrayBufferLike](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ArrayBufferLike/)\>  
                | Uint8ClampedArray<[ArrayBufferLike](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ArrayBufferLike/)\>;  
                height: number;  
                width: number;  
            },  
    ): this[](#updateimage-1)
    
    Update an existing image in a style. This image can be displayed on the map like any other icon in the style's sprite using the image's ID with [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image), [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern), [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern), or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).
    
    An [ErrorEvent](https://docs.maptiler.com/sdk-js/api-reference/classes/ErrorEvent/) will be fired if the image parameter is invalid.
    
    #### Parameters
    
    -   id: string
        
        The ID of the image.
        
    -   image:  
            | [ImageBitmap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageBitmap/)  
            | [StyleImageInterface](https://docs.maptiler.com/sdk-js/api-reference/interfaces/StyleImageInterface/)  
            | [ImageData](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ImageData/)  
            | [HTMLImageElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLImageElement/)  
            | {  
                data: Uint8Array<[ArrayBufferLike](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ArrayBufferLike/)\>  
                | Uint8ClampedArray<[ArrayBufferLike](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ArrayBufferLike/)\>;  
                height: number;  
                width: number;  
            }
        
        The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data` properties with the same format as `ImageData`.
        
    
    #### Returns this
    
    #### Example[](#example-85)
    
    ```typescript
    // If an image with the ID 'cat' already exists in the style's sprite,
    // replace that image with a new image, 'other-cat-icon.png'.
    if (map.hasImage('cat')) map.updateImage('cat', './other-cat-icon.png');
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[updateImage](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#updateimage)
    

### zoomIn[](#zoomin)

-   zoomIn(options?: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/), eventData?: any): this[](#zoomin-1)
    
    Incrementally increases the map's zoom level by 1, first snapping to the nearest `zoomSnap` increment.
    
    Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
    
    #### Parameters
    
    -   `Optional`options: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/)
        
        Options object
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### Example[](#example-86)
    
    Zoom the map in one level with a custom animation duration
    
    ```typescript
    map.zoomIn({duration: 1000});
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[zoomIn](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#zoomin)
    

### zoomOut[](#zoomout)

-   zoomOut(options?: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/), eventData?: any): this[](#zoomout-1)
    
    Decreases the map's zoom level by 1, first snapping to the nearest `zoomSnap` increment.
    
    Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.
    
    #### Parameters
    
    -   `Optional`options: [AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/)
        
        Options object
        
    -   `Optional`eventData: any
        
        Additional properties to be added to event objects of events triggered by this method.
        
    
    #### Returns this
    
    #### Example[](#example-87)
    
    Zoom the map out one level with a custom animation offset
    
    ```typescript
    map.zoomOut({offset: [80, 60]});
    ```
    
    Inherited from [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[zoomOut](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#zoomout)
    

### `Maptiler`zoomTo[](#zoomto)

-   zoomTo(  
        zoom: number,  
        options?: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/)\> | null,  
        eventData?: object,  
    ): this[](#zoomto-1)
    
    Zooms the map to the specified zoom level, with an animated transition.
    
    If `options.experimental_preload` is provided, tiles for the target zoom level are fetched and cached before the animation begins.
    
    #### Parameters
    
    -   zoom: number
    -   `Optional`options: [WithTilePreload](https://docs.maptiler.com/sdk-js/api-reference/types/WithTilePreload/)<[AnimationOptions](https://docs.maptiler.com/sdk-js/api-reference/types/AnimationOptions/)\> | null
    -   `Optional`eventData: object
    
    #### Returns this
    
    #### Remarks[](#remarks-8)
    
    **API Key Usage**: When `experimental_preload` is set, tile requests are issued for the target zoom. These count against your MapTiler Cloud API key quota.
    
    Overrides [MapLibreMap](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/).[zoomTo](https://docs.maptiler.com/sdk-js/api-reference/classes/MapLibreMap/#zoomto)
