Skip to content

Commit 58150bd

Browse files
committed
fix interpolate checks
1 parent 6c987db commit 58150bd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/expression/definitions/interpolate.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,17 @@ class Interpolate implements Expression {
174174
const outputLower = outputs[index].evaluate(ctx);
175175
const outputUpper = outputs[index + 1].evaluate(ctx);
176176

177-
if (this.type.kind == 'projection') {
178-
return interpolate.projection(outputLower, outputUpper, t);
179-
}
180177

181178
switch (this.operator) {
182179
case 'interpolate':
183-
return interpolate[this.type.kind](outputLower, outputUpper, t);
180+
return interpolate[this.type.kind.toString()](outputLower, outputUpper, t);
184181
case 'interpolate-hcl':
185182
return interpolate.color(outputLower, outputUpper, t, 'hcl');
186183
case 'interpolate-lab':
187184
return interpolate.color(outputLower, outputUpper, t, 'lab');
185+
case 'interpolate-projection': {
186+
return interpolate.projection(outputLower, outputUpper, t);
187+
}
188188
}
189189
}
190190

src/validate/validate_projectionconfig.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ describe('Validate projectionConfig', () => {
4141
expect(errors).toHaveLength(0);
4242
});
4343

44-
test('should parse iterpolate-projectionConfig', () => {
45-
const errors = validateProjectionConfig({validateSpec, value: {'type': ['interpolate-projectionConfig', ['linear'], ['zoom'], 0, 'mercator', 5, 'vertical-perspective']}, styleSpec: v8, style: {} as any});
44+
test('should parse iterpolate-projection', () => {
45+
const errors = validateProjectionConfig({validateSpec, value: {'type': ['interpolate-projection', ['linear'], ['zoom'], 0, 'mercator', 5, 'vertical-perspective']}, styleSpec: v8, style: {} as any});
4646
expect(errors).toHaveLength(0);
4747
});
4848

0 commit comments

Comments
 (0)