---
title: "IReadonlyTransform | 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.

# Interface IReadonlyTransform

interface IReadonlyTransform {  
    [applyConstrain](#applyconstrain): [TransformConstrainFunction](https://docs.maptiler.com/sdk-js/api-reference/types/TransformConstrainFunction/);  
    [defaultConstrain](#defaultconstrain): [TransformConstrainFunction](https://docs.maptiler.com/sdk-js/api-reference/types/TransformConstrainFunction/);  
    get [autoCalculateNearFarZ](#autocalculatenearfarzautocalculatenearfarz)(): boolean;  
    get [bearing](#bearingbearing)(): number;  
    get [bearingInRadians](#bearinginradiansbearinginradians)(): number;  
    get [cameraPosition](#camerapositioncameraposition)(): [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/);  
    get [cameraToCenterDistance](#cameratocenterdistancecameratocenterdistance)(): number;  
    get [center](#centercenter)(): [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/);  
    get [centerOffset](#centeroffsetcenteroffset)(): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/);  
    get [centerPoint](#centerpointcenterpoint)(): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/);  
    get [clipSpaceToPixelsMatrix](#clipspacetopixelsmatrixclipspacetopixelsmatrix)(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/);  
    get [constrainOverride](#constrainoverrideconstrainoverride)(): [TransformConstrainFunction](https://docs.maptiler.com/sdk-js/api-reference/types/TransformConstrainFunction/);  
    get [elevation](#elevationelevation)(): number;  
    get [farZ](#farzfarz)(): number;  
    get [fov](#fovfov)(): number;  
    get [fovInRadians](#fovinradiansfovinradians)(): number;  
    get [height](#heightheight)(): number;  
    get [inverseProjectionMatrix](#inverseprojectionmatrixinverseprojectionmatrix)(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/);  
    get [latRange](#latrangelatrange)(): \[number, number\];  
    get [lngRange](#lngrangelngrange)(): \[number, number\];  
    get [maxPitch](#maxpitchmaxpitch)(): number;  
    get [maxZoom](#maxzoommaxzoom)(): number;  
    get [minElevationForCurrentTile](#minelevationforcurrenttileminelevationforcurrenttile)(): number;  
    get [minPitch](#minpitchminpitch)(): number;  
    get [minZoom](#minzoomminzoom)(): number;  
    get [modelViewProjectionMatrix](#modelviewprojectionmatrixmodelviewprojectionmatrix)(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/);  
    get [nearZ](#nearznearz)(): number;  
    get [padding](#paddingpadding)(): [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/);  
    get [pitch](#pitchpitch)(): number;  
    get [pitchInRadians](#pitchinradianspitchinradians)(): number;  
    get [pixelsPerMeter](#pixelspermeterpixelspermeter)(): number;  
    get [pixelsToClipSpaceMatrix](#pixelstoclipspacematrixpixelstoclipspacematrix)(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/);  
    get [pixelsToGLUnits](#pixelstoglunitspixelstoglunits)(): \[number, number\];  
    get [projectionMatrix](#projectionmatrixprojectionmatrix)(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/);  
    get [renderWorldCopies](#renderworldcopiesrenderworldcopies)(): boolean;  
    get [roll](#rollroll)(): number;  
    get [rollInRadians](#rollinradiansrollinradians)(): number;  
    get [rotationMatrix](#rotationmatrixrotationmatrix)(): [mat2](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat2/);  
    get [scale](#scalescale)(): number;  
    get [size](#sizesize)(): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/);  
    get [tileSize](#tilesizetilesize)(): number;  
    get [tileZoom](#tilezoomtilezoom)(): number;  
    get [unmodified](#unmodifiedunmodified)(): boolean;  
    get [width](#widthwidth)(): number;  
    get [worldSize](#worldsizeworldsize)(): number;  
    get [zoom](#zoomzoom)(): number;  
    [calculateCenterFromCameraLngLatAlt](#calculatecenterfromcameralnglatalt-1)(  
        lngLat: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/),  
        alt: number,  
        bearing?: number,  
        pitch?: number,  
    ): { center: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/); elevation: number; zoom: number };  
    [calculateFogMatrix](#calculatefogmatrix-1)(unwrappedTileID: [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/)): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/);  
    [getBounds](#getbounds-1)(): [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/);  
    [getCameraAltitude](#getcameraaltitude-1)(): number;  
    [getCameraFrustum](#getcamerafrustum-1)(): [Frustum](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Frustum/);  
    [getCameraLngLat](#getcameralnglat-1)(): [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/);  
    [getCameraPoint](#getcamerapoint-1)(): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/);  
    [getCameraQueryGeometry](#getcameraquerygeometry-1)(queryGeometry: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)\[\]): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)\[\];  
    [getCircleRadiusCorrection](#getcircleradiuscorrection-1)(): number;  
    [getClippingPlane](#getclippingplane-1)(): [vec4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec4/) | null;  
    [getCoveringTilesDetailsProvider](#getcoveringtilesdetailsprovider-1)(): [CoveringTilesDetailsProvider](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CoveringTilesDetailsProvider/);  
    [getFastPathSimpleProjectionMatrix](#getfastpathsimpleprojectionmatrix-1)(  
        tileID: [OverscaledTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/OverscaledTileID/),  
    ): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/) | undefined;  
    [getMatrixForModel](#getmatrixformodel-1)(location: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/), altitude?: number): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/);  
    [getMaxBounds](#getmaxbounds-1)(): [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/) | null;  
    [getPitchedTextCorrection](#getpitchedtextcorrection-1)(  
        textAnchorX: number,  
        textAnchorY: number,  
        tileID: [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/),  
    ): number;  
    [getPixelScale](#getpixelscale-1)(): number;  
    [getProjectionData](#getprojectiondata-1)(params: [ProjectionDataParams](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionDataParams/)): [ProjectionData](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionData/);  
    [getProjectionDataForCustomLayer](#getprojectiondataforcustomlayer-1)(applyGlobeMatrix: boolean): [ProjectionData](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionData/);  
    [getRayDirectionFromPixel](#getraydirectionfrompixel-1)(p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)): [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/);  
    [getVisibleUnwrappedCoordinates](#getvisibleunwrappedcoordinates-1)(tileID: [CanonicalTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.CanonicalTileID/)): [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/)\[\];  
    [isLocationOccluded](#islocationoccluded-1)(lngLat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)): boolean;  
    [isPaddingEqual](#ispaddingequal-1)(padding: [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/)): boolean;  
    [isPointOnMapSurface](#ispointonmapsurface-1)(p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/), terrain?: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)): boolean;  
    [lngLatToCameraDepth](#lnglattocameradepth-1)(lngLat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/), elevation: number): number;  
    [locationToScreenPoint](#locationtoscreenpoint-1)(lnglat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/), terrain?: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/);  
    [maxPitchScaleFactor](#maxpitchscalefactor-1)(): number;  
    [projectTileCoordinates](#projecttilecoordinates-1)(  
        x: number,  
        y: number,  
        unwrappedTileID: [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/),  
        getElevation: (x: number, y: number) \=> number,  
    ): [PointProjection](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.PointProjection/);  
    [screenPointToLocation](#screenpointtolocation-1)(p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/), terrain?: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)): [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/);  
    [screenPointToMercatorCoordinate](#screenpointtomercatorcoordinate-1)(  
        p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/),  
        terrain?: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/),  
    ): [MercatorCoordinate](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.MercatorCoordinate/);  
    [transformLightDirection](#transformlightdirection-1)(dir: [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/)): [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/);  
}

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

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

##### Index

### Properties[](#properties)

[applyConstrain](#applyconstrain) [defaultConstrain](#defaultconstrain)

### Accessors[](#accessors)

[autoCalculateNearFarZ](#autocalculatenearfarz) [bearing](#bearing) [bearingInRadians](#bearinginradians) [cameraPosition](#cameraposition) [cameraToCenterDistance](#cameratocenterdistance) [center](#center) [centerOffset](#centeroffset) [centerPoint](#centerpoint) [clipSpaceToPixelsMatrix](#clipspacetopixelsmatrix) [constrainOverride](#constrainoverride) [elevation](#elevation) [farZ](#farz) [fov](#fov) [fovInRadians](#fovinradians) [height](#height) [inverseProjectionMatrix](#inverseprojectionmatrix) [latRange](#latrange) [lngRange](#lngrange) [maxPitch](#maxpitch) [maxZoom](#maxzoom) [minElevationForCurrentTile](#minelevationforcurrenttile) [minPitch](#minpitch) [minZoom](#minzoom) [modelViewProjectionMatrix](#modelviewprojectionmatrix) [nearZ](#nearz) [padding](#padding) [pitch](#pitch) [pitchInRadians](#pitchinradians) [pixelsPerMeter](#pixelspermeter) [pixelsToClipSpaceMatrix](#pixelstoclipspacematrix) [pixelsToGLUnits](#pixelstoglunits) [projectionMatrix](#projectionmatrix) [renderWorldCopies](#renderworldcopies) [roll](#roll) [rollInRadians](#rollinradians) [rotationMatrix](#rotationmatrix) [scale](#scale) [size](#size) [tileSize](#tilesize) [tileZoom](#tilezoom) [unmodified](#unmodified) [width](#width) [worldSize](#worldsize) [zoom](#zoom)

### Methods[](#methods)

[calculateCenterFromCameraLngLatAlt](#calculatecenterfromcameralnglatalt) [calculateFogMatrix](#calculatefogmatrix) [getBounds](#getbounds) [getCameraAltitude](#getcameraaltitude) [getCameraFrustum](#getcamerafrustum) [getCameraLngLat](#getcameralnglat) [getCameraPoint](#getcamerapoint) [getCameraQueryGeometry](#getcameraquerygeometry) [getCircleRadiusCorrection](#getcircleradiuscorrection) [getClippingPlane](#getclippingplane) [getCoveringTilesDetailsProvider](#getcoveringtilesdetailsprovider) [getFastPathSimpleProjectionMatrix](#getfastpathsimpleprojectionmatrix) [getMatrixForModel](#getmatrixformodel) [getMaxBounds](#getmaxbounds) [getPitchedTextCorrection](#getpitchedtextcorrection) [getPixelScale](#getpixelscale) [getProjectionData](#getprojectiondata) [getProjectionDataForCustomLayer](#getprojectiondataforcustomlayer) [getRayDirectionFromPixel](#getraydirectionfrompixel) [getVisibleUnwrappedCoordinates](#getvisibleunwrappedcoordinates) [isLocationOccluded](#islocationoccluded) [isPaddingEqual](#ispaddingequal) [isPointOnMapSurface](#ispointonmapsurface) [lngLatToCameraDepth](#lnglattocameradepth) [locationToScreenPoint](#locationtoscreenpoint) [maxPitchScaleFactor](#maxpitchscalefactor) [projectTileCoordinates](#projecttilecoordinates) [screenPointToLocation](#screenpointtolocation) [screenPointToMercatorCoordinate](#screenpointtomercatorcoordinate) [transformLightDirection](#transformlightdirection)

## Properties[](#properties-1)

### applyConstrain[](#applyconstrain)

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

Constrain the center lngLat and zoom to ensure that longitude and latitude bounds are respected and regions beyond the map bounds are not displayed.

### defaultConstrain[](#defaultconstrain)

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

#### Internal[](#internal)

The tranform's default callback that ensures that longitude and latitude bounds are respected by the viewport.

## Accessors[](#accessors-1)

### autoCalculateNearFarZ[](#autocalculatenearfarz)

-   get autoCalculateNearFarZ(): boolean
    
    #### Returns boolean
    
    Inherited from ITransformGetters.autoCalculateNearFarZ
    

### bearing[](#bearing)

-   get bearing(): number
    
    Bearing in degrees.
    
    #### Returns number
    
    Inherited from ITransformGetters.bearing
    

### bearingInRadians[](#bearinginradians)

-   get bearingInRadians(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.bearingInRadians
    

### cameraPosition[](#cameraposition)

-   get cameraPosition(): [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/)
    
    #### Returns [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/)
    
    #### Internal[](#internal-1)
    
    Returns the camera's position transformed to be in the same space as 3D features under this transform's projection. Mostly used for globe + fill-extrusion.
    

### cameraToCenterDistance[](#cameratocenterdistance)

-   get cameraToCenterDistance(): number
    
    Distance from camera origin to view plane, in pixels. Calculated using vertical fov and viewport height. Center is considered to be in the middle of the viewport.
    
    #### Returns number
    
    Overrides ITransformGetters.cameraToCenterDistance
    

### center[](#center)

-   get center(): [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
    
    #### Returns [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
    
    Inherited from ITransformGetters.center
    

### centerOffset[](#centeroffset)

-   get centerOffset(): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    
    #### Returns [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    

### centerPoint[](#centerpoint)

-   get centerPoint(): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    
    The center of the screen in pixels with the top-left corner being (0,0) and +y axis pointing downwards. This accounts for padding.
    
    #### Returns [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    

### clipSpaceToPixelsMatrix[](#clipspacetopixelsmatrix)

-   get clipSpaceToPixelsMatrix(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    
    #### Returns [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    

### constrainOverride[](#constrainoverride)

-   get constrainOverride(): [TransformConstrainFunction](https://docs.maptiler.com/sdk-js/api-reference/types/TransformConstrainFunction/)
    
    #### Returns [TransformConstrainFunction](https://docs.maptiler.com/sdk-js/api-reference/types/TransformConstrainFunction/)
    
    Inherited from ITransformGetters.constrainOverride
    

### elevation[](#elevation)

-   get elevation(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.elevation
    

### farZ[](#farz)

-   get farZ(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.farZ
    

### fov[](#fov)

-   get fov(): number
    
    Vertical field of view in degrees.
    
    #### Returns number
    
    Inherited from ITransformGetters.fov
    

### fovInRadians[](#fovinradians)

-   get fovInRadians(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.fovInRadians
    

### height[](#height)

-   get height(): number
    
    Gets the transform's height in pixels. Use [ITransform.resize](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ITransformMutators/#resize) to set the transform's size.
    
    #### Returns number
    
    Inherited from ITransformGetters.height
    

### inverseProjectionMatrix[](#inverseprojectionmatrix)

-   get inverseProjectionMatrix(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    
    Inverse of matrix from camera space to clip space.
    
    #### Returns [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    

### latRange[](#latrange)

-   get latRange(): \[number, number\]
    
    #### Returns \[number, number\]
    
    Inherited from ITransformGetters.latRange
    

### lngRange[](#lngrange)

-   get lngRange(): \[number, number\]
    
    #### Returns \[number, number\]
    
    Inherited from ITransformGetters.lngRange
    

### maxPitch[](#maxpitch)

-   get maxPitch(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.maxPitch
    

### maxZoom[](#maxzoom)

-   get maxZoom(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.maxZoom
    

### minElevationForCurrentTile[](#minelevationforcurrenttile)

-   get minElevationForCurrentTile(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.minElevationForCurrentTile
    

### minPitch[](#minpitch)

-   get minPitch(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.minPitch
    

### minZoom[](#minzoom)

-   get minZoom(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.minZoom
    

### modelViewProjectionMatrix[](#modelviewprojectionmatrix)

-   get modelViewProjectionMatrix(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    
    #### Returns [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    

### nearZ[](#nearz)

-   get nearZ(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.nearZ
    

### padding[](#padding)

-   get padding(): [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/)
    
    #### Returns [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/)
    
    Inherited from ITransformGetters.padding
    

### pitch[](#pitch)

-   get pitch(): number
    
    Pitch in degrees.
    
    #### Returns number
    
    Inherited from ITransformGetters.pitch
    

### pitchInRadians[](#pitchinradians)

-   get pitchInRadians(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.pitchInRadians
    

### pixelsPerMeter[](#pixelspermeter)

-   get pixelsPerMeter(): number
    
    #### Returns number
    
    #### Internal[](#internal-2)
    

### pixelsToClipSpaceMatrix[](#pixelstoclipspacematrix)

-   get pixelsToClipSpaceMatrix(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    
    #### Returns [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    

### pixelsToGLUnits[](#pixelstoglunits)

-   get pixelsToGLUnits(): \[number, number\]
    
    #### Returns \[number, number\]
    

### projectionMatrix[](#projectionmatrix)

-   get projectionMatrix(): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    
    #### Returns [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    

### renderWorldCopies[](#renderworldcopies)

-   get renderWorldCopies(): boolean
    
    #### Returns boolean
    
    Inherited from ITransformGetters.renderWorldCopies
    

### roll[](#roll)

-   get roll(): number
    
    Roll in degrees.
    
    #### Returns number
    
    Inherited from ITransformGetters.roll
    

### rollInRadians[](#rollinradians)

-   get rollInRadians(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.rollInRadians
    

### rotationMatrix[](#rotationmatrix)

-   get rotationMatrix(): [mat2](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat2/)
    
    #### Returns [mat2](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat2/)
    

### scale[](#scale)

-   get scale(): number
    
    How many times "larger" the world is compared to zoom 0. Usually computed as `pow(2, zoom)`. Relevant mostly for mercator projection.
    
    #### Returns number
    
    Inherited from ITransformGetters.scale
    

### size[](#size)

-   get size(): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    
    Gets the transform's width and height in pixels (viewport size). Use resize to set the transform's size.
    
    #### Returns [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    

### tileSize[](#tilesize)

-   get tileSize(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.tileSize
    

### tileZoom[](#tilezoom)

-   get tileZoom(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.tileZoom
    

### unmodified[](#unmodified)

-   get unmodified(): boolean
    
    #### Returns boolean
    
    Inherited from ITransformGetters.unmodified
    

### width[](#width)

-   get width(): number
    
    Gets the transform's width in pixels. Use [ITransform.resize](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ITransformMutators/#resize) to set the transform's size.
    
    #### Returns number
    
    Inherited from ITransformGetters.width
    

### worldSize[](#worldsize)

-   get worldSize(): number
    
    How many units the current world has. Computed by multiplying [worldSize](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ITransformGetters/#worldsize) by [tileSize](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ITransformGetters/#tilesize). Relevant mostly for mercator projection.
    
    #### Returns number
    
    Inherited from ITransformGetters.worldSize
    

### zoom[](#zoom)

-   get zoom(): number
    
    #### Returns number
    
    Inherited from ITransformGetters.zoom
    

## Methods[](#methods-1)

### calculateCenterFromCameraLngLatAlt[](#calculatecenterfromcameralnglatalt)

-   calculateCenterFromCameraLngLatAlt(  
        lngLat: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/),  
        alt: number,  
        bearing?: number,  
        pitch?: number,  
    ): { center: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/); elevation: number; zoom: number }[](#calculatecenterfromcameralnglatalt-1)
    
    Given the camera position (lng, lat, alt), calculate the center point and zoom level
    
    #### Parameters
    
    -   lngLat: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/)
        
        lng, lat of the camera
        
    -   alt: number
        
        altitude of the camera above sea level, in meters
        
    -   `Optional`bearing: number
        
        bearing of the camera, in degrees
        
    -   `Optional`pitch: number
        
        pitch angle of the camera, in degrees
        
    
    #### Returns { center: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/); elevation: number; zoom: number }
    

### calculateFogMatrix[](#calculatefogmatrix)

-   calculateFogMatrix(unwrappedTileID: [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/)): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)[](#calculatefogmatrix-1)
    
    #### Parameters
    
    -   unwrappedTileID: [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/)
        
        the tile ID
        
    
    #### Returns [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    
    #### Internal[](#internal-3)
    
    Calculate the fogMatrix that, given a tile coordinate, would be used to calculate fog on the map. Currently only supported in mercator projection.
    

### getBounds[](#getbounds)

-   getBounds(): [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/)[](#getbounds-1)
    
    #### Returns [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/)
    
    Returns a [LngLatBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLatBounds/) object describing the map's geographical bounds.
    
    #### Internal[](#internal-4)
    
    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.
    

### getCameraAltitude[](#getcameraaltitude)

-   getCameraAltitude(): number[](#getcameraaltitude-1)
    
    The altitude of the camera above the sea level in meters.
    
    #### Returns number
    

### getCameraFrustum[](#getcamerafrustum)

-   getCameraFrustum(): [Frustum](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Frustum/)[](#getcamerafrustum-1)
    
    #### Returns [Frustum](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Frustum/)
    
    #### Internal[](#internal-5)
    
    Return the camera frustum for the current view.
    

### getCameraLngLat[](#getcameralnglat)

-   getCameraLngLat(): [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)[](#getcameralnglat-1)
    
    The longitude and latitude of the camera.
    
    #### Returns [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
    

### getCameraPoint[](#getcamerapoint)

-   getCameraPoint(): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)[](#getcamerapoint-1)
    
    The camera looks at the map from a 3D (lng, lat, altitude) location. Let's use `cameraLocation` as the name for the location under the camera and on the surface of the earth (lng, lat, 0). `cameraPoint` is the projected position of the `cameraLocation`.
    
    This point is useful to us because only fill-extrusions that are between `cameraPoint` and the query point on the surface of the earth can extend and intersect the query.
    
    When the map is not pitched the `cameraPoint` is equivalent to the center of the map because the camera is right above the center of the map.
    
    #### Returns [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    

### getCameraQueryGeometry[](#getcameraquerygeometry)

-   getCameraQueryGeometry(queryGeometry: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)\[\]): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)\[\][](#getcameraquerygeometry-1)
    
    When the map is pitched, some of the 3D features that intersect a query will not intersect the query at the surface of the earth. Instead the feature may be closer and only intersect the query because it extrudes into the air.
    
    #### Parameters
    
    -   queryGeometry: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)\[\]
        
        For point queries, the line from the query point to the "camera point", for other geometries, the envelope of the query geometry and the "camera point"
        
    
    #### Returns [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)\[\]
    
    a geometry that includes all of the original query as well as all possible ares of the screen where the _base_ of a visible extrusion could be.
    

### getCircleRadiusCorrection[](#getcircleradiuscorrection)

-   getCircleRadiusCorrection(): number[](#getcircleradiuscorrection-1)
    
    #### Returns number
    
    #### Internal[](#internal-6)
    
    Allows the projection to adjust the radius of `circle-pitch-alignment: 'map'` circles and heatmap kernels based on the map's latitude. Circle radius and heatmap kernel radius is multiplied by this value.
    

### getClippingPlane[](#getclippingplane)

-   getClippingPlane(): [vec4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec4/) | null[](#getclippingplane-1)
    
    #### Returns [vec4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec4/) | null
    
    #### Internal[](#internal-7)
    
    Return the clipping plane, behind which nothing should be rendered. If the camera frustum is sufficient to describe the render geometry (additional clipping is not required), this may be null.
    

### getCoveringTilesDetailsProvider[](#getcoveringtilesdetailsprovider)

-   getCoveringTilesDetailsProvider(): [CoveringTilesDetailsProvider](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CoveringTilesDetailsProvider/)[](#getcoveringtilesdetailsprovider-1)
    
    #### Returns [CoveringTilesDetailsProvider](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CoveringTilesDetailsProvider/)
    
    #### Internal[](#internal-8)
    
    Returns this transform's CoveringTilesDetailsProvider.
    

### getFastPathSimpleProjectionMatrix[](#getfastpathsimpleprojectionmatrix)

-   getFastPathSimpleProjectionMatrix(tileID: [OverscaledTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/OverscaledTileID/)): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/) | undefined[](#getfastpathsimpleprojectionmatrix-1)
    
    Returns a tile-specific projection matrix. Used for symbol placement fast-path for mercator transform.
    
    #### Parameters
    
    -   tileID: [OverscaledTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/OverscaledTileID/)
    
    #### Returns [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/) | undefined
    

### getMatrixForModel[](#getmatrixformodel)

-   getMatrixForModel(location: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/), altitude?: number): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)[](#getmatrixformodel-1)
    
    Returns a matrix that will place, rotate and scale a model to display at the given location and altitude while also being projected by the custom layer matrix. This function is intended to be called from custom layers.
    
    #### Parameters
    
    -   location: [LngLatLike](https://docs.maptiler.com/sdk-js/api-reference/types/LngLatLike/)
        
        Location of the model.
        
    -   `Optional`altitude: number
        
        Altitude of the model. May be undefined.
        
    
    #### Returns [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)
    

### 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
    
    max bounds
    

### getPitchedTextCorrection[](#getpitchedtextcorrection)

-   getPitchedTextCorrection(  
        textAnchorX: number,  
        textAnchorY: number,  
        tileID: [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/),  
    ): number[](#getpitchedtextcorrection-1)
    
    #### Parameters
    
    -   textAnchorX: number
        
        Text anchor position inside the tile, X axis.
        
    -   textAnchorY: number
        
        Text anchor position inside the tile, Y axis.
        
    -   tileID: [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/)
        
        The tile coordinates.
        
    
    #### Returns number
    
    #### Internal[](#internal-9)
    
    Allows the projection to adjust the scale of `text-pitch-alignment: 'map'` symbols's collision boxes based on the map's center and the text anchor. Only affects the collision boxes (and click areas), scaling of the rendered text is mostly handled in shaders.
    

### getPixelScale[](#getpixelscale)

-   getPixelScale(): number[](#getpixelscale-1)
    
    #### Returns number
    
    #### Internal[](#internal-10)
    

### getProjectionData[](#getprojectiondata)

-   getProjectionData(params: [ProjectionDataParams](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionDataParams/)): [ProjectionData](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionData/)[](#getprojectiondata-1)
    
    #### Parameters
    
    -   params: [ProjectionDataParams](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionDataParams/)
        
        Parameters for the projection data generation.
        
    
    #### Returns [ProjectionData](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionData/)
    
    #### Internal[](#internal-11)
    
    Generates a `ProjectionData` instance to be used while rendering the supplied tile.
    

### getProjectionDataForCustomLayer[](#getprojectiondataforcustomlayer)

-   getProjectionDataForCustomLayer(applyGlobeMatrix: boolean): [ProjectionData](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionData/)[](#getprojectiondataforcustomlayer-1)
    
    Return projection data such that coordinates in mercator projection in range 0..1 will get projected to the map correctly.
    
    #### Parameters
    
    -   applyGlobeMatrix: boolean
    
    #### Returns [ProjectionData](https://docs.maptiler.com/sdk-js/api-reference/types/ProjectionData/)
    

### getRayDirectionFromPixel[](#getraydirectionfrompixel)

-   getRayDirectionFromPixel(p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)): [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/)[](#getraydirectionfrompixel-1)
    
    #### Parameters
    
    -   p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    
    #### Returns [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/)
    

### getVisibleUnwrappedCoordinates[](#getvisibleunwrappedcoordinates)

-   getVisibleUnwrappedCoordinates(tileID: [CanonicalTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.CanonicalTileID/)): [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/)\[\][](#getvisibleunwrappedcoordinates-1)
    
    #### Parameters
    
    -   tileID: [CanonicalTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.CanonicalTileID/)
    
    #### Returns [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/)\[\]
    
    #### Internal[](#internal-12)
    
    Return any "wrapped" copies of a given tile coordinate that are visible in the current view.
    

### isLocationOccluded[](#islocationoccluded)

-   isLocationOccluded(lngLat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)): boolean[](#islocationoccluded-1)
    
    #### Parameters
    
    -   lngLat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
    
    #### Returns boolean
    
    #### Internal[](#internal-13)
    
    Returns whether the supplied location is occluded in this projection. For example during globe rendering a location on the backfacing side of the globe is occluded.
    

### isPaddingEqual[](#ispaddingequal)

-   isPaddingEqual(padding: [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/)): boolean[](#ispaddingequal-1)
    
    Returns if the padding params match
    
    #### Parameters
    
    -   padding: [PaddingOptions](https://docs.maptiler.com/sdk-js/api-reference/types/PaddingOptions/)
        
        the padding to check against
        
    
    #### Returns boolean
    
    true if they are equal, false otherwise
    

### isPointOnMapSurface[](#ispointonmapsurface)

-   isPointOnMapSurface(p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/), terrain?: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)): boolean[](#ispointonmapsurface-1)
    
    #### Parameters
    
    -   p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
        
        The point's coordinates.
        
    -   `Optional`terrain: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)
        
        Optional terrain.
        
    
    #### Returns boolean
    
    #### Internal[](#internal-14)
    
    Returns whether the specified screen point lies on the map. May return false if, for example, the point is above the map's horizon, or if doesn't lie on the planet's surface if globe is enabled.
    

### lngLatToCameraDepth[](#lnglattocameradepth)

-   lngLatToCameraDepth(lngLat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/), elevation: number): number[](#lnglattocameradepth-1)
    
    Return the distance to the camera in clip space from a LngLat. This can be compared to the value from the depth buffer (terrain.depthAtPoint) to determine whether a point is occluded.
    
    #### Parameters
    
    -   lngLat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
        
        the point
        
    -   elevation: number
        
        the point's elevation
        
    
    #### Returns number
    
    depth value in clip space (between 0 and 1)
    

### locationToScreenPoint[](#locationtoscreenpoint)

-   locationToScreenPoint(lnglat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/), terrain?: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)): [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)[](#locationtoscreenpoint-1)
    
    #### Parameters
    
    -   lnglat: [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
        
        location
        
    -   `Optional`terrain: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)
        
        optional terrain
        
    
    #### Returns [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
    
    screen point
    
    #### Internal[](#internal-15)
    
    Given a LngLat location, return the screen point that corresponds to it.
    

### maxPitchScaleFactor[](#maxpitchscalefactor)

-   maxPitchScaleFactor(): number[](#maxpitchscalefactor-1)
    
    #### Returns number
    

### projectTileCoordinates[](#projecttilecoordinates)

-   projectTileCoordinates(  
        x: number,  
        y: number,  
        unwrappedTileID: [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/),  
        getElevation: (x: number, y: number) \=> number,  
    ): [PointProjection](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.PointProjection/)[](#projecttilecoordinates-1)
    
    #### Parameters
    
    -   x: number
    -   y: number
    -   unwrappedTileID: [UnwrappedTileID](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.UnwrappedTileID/)
    -   getElevation: (x: number, y: number) \=> number
    
    #### Returns [PointProjection](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.PointProjection/)
    
    #### Internal[](#internal-16)
    
    Projects a point in tile coordinates to clip space. Used in symbol rendering.
    

### screenPointToLocation[](#screenpointtolocation)

-   screenPointToLocation(p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/), terrain?: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)): [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)[](#screenpointtolocation-1)
    
    #### Parameters
    
    -   p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
        
        screen point
        
    -   `Optional`terrain: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)
        
        optional terrain
        
    
    #### Returns [LngLat](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.LngLat/)
    
    lnglat location
    
    #### Internal[](#internal-17)
    
    Given a point on screen, return its LngLat location.
    

### screenPointToMercatorCoordinate[](#screenpointtomercatorcoordinate)

-   screenPointToMercatorCoordinate(p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/), terrain?: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)): [MercatorCoordinate](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.MercatorCoordinate/)[](#screenpointtomercatorcoordinate-1)
    
    #### Parameters
    
    -   p: [Point](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Point/)
        
        the point
        
    -   `Optional`terrain: [Terrain](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.Terrain/)
        
        optional terrain
        
    
    #### Returns [MercatorCoordinate](https://docs.maptiler.com/sdk-js/api-reference/classes/Externals.MercatorCoordinate/)
    
    lnglat
    
    #### Internal[](#internal-18)
    
    Given a point on screen, return its mercator coordinate.
    

### transformLightDirection[](#transformlightdirection)

-   transformLightDirection(dir: [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/)): [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/)[](#transformlightdirection-1)
    
    #### Parameters
    
    -   dir: [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/)
        
        The light direction.
        
    
    #### Returns [vec3](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.vec3/)
    
    A new vector with the transformed light direction.
    
    #### Internal[](#internal-19)
    
    Returns light direction transformed to be in the same space as 3D features under this projection. Mostly used for globe + fill-extrusion.
