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

# Type Alias ProjectionData

This type contains all data necessary to project a tile to screen in MapLibre's shader system. Contains data used for both mercator and globe projection.

type ProjectionData \= {  
    [clippingPlane](#clippingplane): \[number, number, number, number\];  
    [fallbackMatrix](#fallbackmatrix): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/);  
    [mainMatrix](#mainmatrix): [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/);  
    [projectionTransition](#projectiontransition): number;  
    [tileMercatorCoords](#tilemercatorcoords): \[number, number, number, number\];  
}

##### Index

### Properties[](#properties)

[clippingPlane](#clippingplane) [fallbackMatrix](#fallbackmatrix) [mainMatrix](#mainmatrix) [projectionTransition](#projectiontransition) [tileMercatorCoords](#tilemercatorcoords)

## Properties[](#properties-1)

### clippingPlane[](#clippingplane)

clippingPlane: \[number, number, number, number\]

The plane equation for a plane that intersects the planet's horizon. Assumes the planet to be a unit sphere. Used by globe projection for clipping. Uniform name: `u_projection_clipping_plane`.

### fallbackMatrix[](#fallbackmatrix)

fallbackMatrix: [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)

Fallback matrix that projects the current tile according to mercator projection. Used by globe projection to fall back to mercator projection in an animated way. Uniform name: `u_projection_fallback_matrix`.

### mainMatrix[](#mainmatrix)

mainMatrix: [mat4](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.mat4/)

The main projection matrix. For mercator projection, it usually projects in-tile coordinates 0..EXTENT to screen, for globe projection, it projects a unit sphere planet to screen. Uniform name: `u_projection_matrix`.

### projectionTransition[](#projectiontransition)

projectionTransition: number

A value in range 0..1 indicating interpolation between mercator (0) and globe (1) projections. Used by globe projection to hide projection transition at high zooms. Uniform name: `u_projection_transition`.

### tileMercatorCoords[](#tilemercatorcoords)

tileMercatorCoords: \[number, number, number, number\]

The extent of current tile in the mercator square. Used by globe projection. First two components are X and Y offset, last two are X and Y scale. Uniform name: `u_projection_tile_mercator_coords`.

Conversion from in-tile coordinates in range 0..EXTENT is done as follows:

#### Example[](#example)

```typescript
vec2 mercator_coords = u_projection_tile_mercator_coords.xy + in_tile.xy * u_projection_tile_mercator_coords.zw;
```
