diff --git a/packages/config/src/config/vector.style.ts b/packages/config/src/config/vector.style.ts index b9cac37d4..db6afb48c 100644 --- a/packages/config/src/config/vector.style.ts +++ b/packages/config/src/config/vector.style.ts @@ -74,6 +74,16 @@ export interface Terrain { exaggeration: number; } +/** + * https://maplibre.org/maplibre-style-spec/projection/ + * + * `type` is either one of MapLibre's built in projections ("mercator" | "globe") + * or the name of a projection registered with `maplibregl.addProjection()`, eg "EPSG:2193" + */ +export interface Projection { + type: string; +} + export type Source = SourceVector | SourceRaster | SourceRasterDem; export type Sources = Record; @@ -107,6 +117,9 @@ export interface StyleJson { /** OPTIONAL - A global modifier that elevates layers and markers based on a DEM data source */ terrain?: Terrain; + + /** OPTIONAL - The projection the tiles are served in, if not the default "mercator" */ + projection?: Projection; } export interface ConfigVectorStyle extends ConfigBase { diff --git a/packages/lambda-tiler/src/routes/__tests__/tile.style.json.test.ts b/packages/lambda-tiler/src/routes/__tests__/tile.style.json.test.ts index 2c69a7843..e6159a0b6 100644 --- a/packages/lambda-tiler/src/routes/__tests__/tile.style.json.test.ts +++ b/packages/lambda-tiler/src/routes/__tests__/tile.style.json.test.ts @@ -582,5 +582,6 @@ describe('/v1/styles', () => { ], }, }); + assert.deepEqual(style.projection, { type: 'EPSG:2193' }); }); }); diff --git a/packages/lambda-tiler/src/routes/tile.style.json.ts b/packages/lambda-tiler/src/routes/tile.style.json.ts index a93c78773..35220665e 100644 --- a/packages/lambda-tiler/src/routes/tile.style.json.ts +++ b/packages/lambda-tiler/src/routes/tile.style.json.ts @@ -385,7 +385,10 @@ export async function styleJsonGet(req: LambdaHttpRequest): Promise 0) targetStyle.layers = targetStyle.layers.filter((f) => !excluded.has(f.id.toLowerCase()));