Skip to content

Commit 7b1e9ae

Browse files
committed
Explicit projection naming
1 parent 248b4f5 commit 7b1e9ae

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/diff.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,10 +607,10 @@ describe('diff', () => {
607607
} as StyleSpecification,
608608
{
609609
projection: {
610-
type: 'globe'
610+
type: 'sphere'
611611
}
612612
} as StyleSpecification)).toEqual([
613-
{command: 'setProjection', args: [{type: 'globe'}]},
613+
{command: 'setProjection', args: [{type: 'sphere'}]},
614614
]);
615615
});
616616
});

src/reference/v8.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"type": "projection",
130130
"doc": "The projection configuration. **Note:** this definition is still experimental and is under development in maplibre-gl-js.",
131131
"example": {
132-
"type": "globe"
132+
"type": "web-mercator"
133133
}
134134
},
135135
"terrain": {
@@ -4538,7 +4538,7 @@
45384538
]
45394539
},
45404540
"transition": true,
4541-
"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."
4541+
"doc": "How to blend the atmosphere. Where 1 is visible atmosphere and 0 is hidden. It is best to interpolate this expression when using spherical-to-web-mercator projection."
45424542
}
45434543
},
45444544
"terrain": {
@@ -4572,13 +4572,16 @@
45724572
"type": {
45734573
"type": "enum",
45744574
"doc": "The projection type.",
4575-
"default": "mercator",
4575+
"default": "web-mercator",
45764576
"values": {
4577-
"mercator": {
4578-
"doc": "The Mercator projection."
4577+
"web-mercator": {
4578+
"doc": "Web Mercator projection."
45794579
},
4580-
"globe": {
4581-
"doc": "The globe projection."
4580+
"spherical": {
4581+
"doc": "\"Static Globe\". Spherical projection."
4582+
},
4583+
"spherical-to-web-mercator": {
4584+
"doc": "\"Adaptive Globe\". Transition from a Spherical projection to a Web Mercator projection on zoom."
45824585
}
45834586
}
45844587
}

src/validate/validate_projection.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ describe('Validate projection', () => {
2626
test('Should return errors according to spec violations', () => {
2727
const errors = validateProjection({validateSpec, value: {type: 1 as any}, styleSpec: v8, style: {} as any});
2828
expect(errors).toHaveLength(1);
29-
expect(errors[0].message).toBe('type: expected one of [mercator, globe], 1 found');
29+
expect(errors[0].message).toBe('type: expected one of [web-mercator, spherical, spherical-to-web-mercator], 1 found');
3030
});
3131

3232
test('Should pass if everything is according to spec', () => {
33-
let errors = validateProjection({validateSpec, value: {type: 'globe'}, styleSpec: v8, style: {} as any});
33+
let errors = validateProjection({validateSpec, value: {type: 'spherical-to-web-mercator'}, styleSpec: v8, style: {} as any});
3434
expect(errors).toHaveLength(0);
35-
errors = validateProjection({validateSpec, value: {type: 'mercator'}, styleSpec: v8, style: {} as any});
35+
errors = validateProjection({validateSpec, value: {type: 'web-mercator'}, styleSpec: v8, style: {} as any});
3636
expect(errors).toHaveLength(0);
3737
});
3838
});

0 commit comments

Comments
 (0)