Skip to content

Both copy text to your clipboard — Build with AI copies a setup prompt to paste into Claude Code, Cursor, Codex or Copilot; Copy page as Markdown copies this page to paste into a chat. How it works

Projection ​

Defined in: src/geo/projection/projection.ts:45

An interface the implementations of which are used internally by mapmetrics to handle different projections.

Accessors ​

shaderDefine ​

Get Signature ​

get shaderDefine(): string

Defined in: src/geo/projection/projection.ts:72

A #define macro that is injected into every mapmetrics shader that uses this projection.

Example ​
ts
`const define = projection.shaderDefine; // '#define GLOBE'`
Returns ​

string


shaderVariantName ​

Get Signature ​

get shaderVariantName(): string

Defined in: src/geo/projection/projection.ts:65

Name of the shader projection variant that should be used for this projection. Note that this value may change dynamically, for example when globe projection internally transitions to mercator. Then globe projection might start reporting the mercator shader variant name to make mapmetrics use faster mercator shaders.

Returns ​

string


vertexShaderPreludeCode ​

Get Signature ​

get vertexShaderPreludeCode(): string

Defined in: src/geo/projection/projection.ts:83

Vertex shader code that is injected into every mapmetrics vertex shader that uses this projection.

Returns ​

string