From d009e1d701b9d0d8dc298b8c87bff4e4a225cdc5 Mon Sep 17 00:00:00 2001 From: Birk Skyum <74932975+birkskyum@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:28:56 +0100 Subject: [PATCH] Rename adaptive `globe` to `globe-to-mercator` (#878) --- CHANGELOG.md | 1 + src/diff.test.ts | 4 ++-- src/reference/v8.json | 10 +++++----- src/validate/validate_projection.test.ts | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59a79041d..09c73da5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## main ### ✨ Features and improvements +- Rename adaptive globe from `globe` to `globe-to-mercator` ([#878](https://github.com/maplibre/maplibre-style-spec/pull/878)) - _...Add new stuff here..._ ### 🐞 Bug fixes diff --git a/src/diff.test.ts b/src/diff.test.ts index 3a35fdb92..a1db3e48a 100644 --- a/src/diff.test.ts +++ b/src/diff.test.ts @@ -607,10 +607,10 @@ describe('diff', () => { } as StyleSpecification, { projection: { - type: 'globe' + type: 'globe-to-mercator' } } as StyleSpecification)).toEqual([ - {command: 'setProjection', args: [{type: 'globe'}]}, + {command: 'setProjection', args: [{type: 'globe-to-mercator'}]}, ]); }); }); diff --git a/src/reference/v8.json b/src/reference/v8.json index be7d35092..772155ebe 100644 --- a/src/reference/v8.json +++ b/src/reference/v8.json @@ -129,7 +129,7 @@ "type": "projection", "doc": "The projection configuration. **Note:** this definition is still experimental and is under development in maplibre-gl-js.", "example": { - "type": "globe" + "type": "globe-to-mercator" } }, "terrain": { @@ -4538,7 +4538,7 @@ ] }, "transition": true, - "doc": "How to blend the atmosphere. Where 1 is visible atmosphere and 0 is hidden. It is best to interpolate this expression when using globe projection." + "doc": "How to blend the atmosphere. Where 1 is visible atmosphere and 0 is hidden. It is best to interpolate this expression when using globe-to-mercator projection." } }, "terrain": { @@ -4575,10 +4575,10 @@ "default": "mercator", "values": { "mercator": { - "doc": "The Mercator projection." + "doc": "Web Mercator projection." }, - "globe": { - "doc": "The globe projection." + "globe-to-mercator": { + "doc": "Spherical projection with zoom transition to Web Mercator projection." } } } diff --git a/src/validate/validate_projection.test.ts b/src/validate/validate_projection.test.ts index a0c02f8a3..175b196ec 100644 --- a/src/validate/validate_projection.test.ts +++ b/src/validate/validate_projection.test.ts @@ -26,11 +26,11 @@ describe('Validate projection', () => { test('Should return errors according to spec violations', () => { const errors = validateProjection({validateSpec, value: {type: 1 as any}, styleSpec: v8, style: {} as any}); expect(errors).toHaveLength(1); - expect(errors[0].message).toBe('type: expected one of [mercator, globe], 1 found'); + expect(errors[0].message).toBe('type: expected one of [mercator, globe-to-mercator], 1 found'); }); test('Should pass if everything is according to spec', () => { - let errors = validateProjection({validateSpec, value: {type: 'globe'}, styleSpec: v8, style: {} as any}); + let errors = validateProjection({validateSpec, value: {type: 'globe-to-mercator'}, styleSpec: v8, style: {} as any}); expect(errors).toHaveLength(0); errors = validateProjection({validateSpec, value: {type: 'mercator'}, styleSpec: v8, style: {} as any}); expect(errors).toHaveLength(0);