-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add interpolate function (#325)
- Loading branch information
Showing
9 changed files
with
265 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { MbStyle } from '../../src/MapboxStyleParser'; | ||
|
||
const expressionInterpolate: MbStyle = { | ||
version: 8, | ||
name: 'Expression Interpolate', | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: 'earthquake_circle', | ||
type: 'circle', | ||
source: 'testsource', | ||
'source-layer': 'foo', | ||
paint: { | ||
'circle-color': '#000000', | ||
'circle-opacity': 0.6, | ||
'circle-radius': [ | ||
'interpolate', | ||
['linear'], | ||
['get', 'population'], | ||
12, | ||
2, | ||
15, | ||
4, | ||
19, | ||
35 | ||
] | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export default expressionInterpolate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { MbStyle } from '../../src/MapboxStyleParser'; | ||
|
||
const expression_case: MbStyle = { | ||
version: 8, | ||
name: 'Expression Interpolate', | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: 'r0_sy0_st0', | ||
source: 'testsource', | ||
'source-layer': 'foo', | ||
type: 'circle', | ||
paint: { | ||
'circle-color': '#000000', | ||
'circle-opacity': 0.6, | ||
'circle-radius': [ | ||
'interpolate', | ||
['linear'], | ||
['get', 'population'], | ||
12, | ||
2, | ||
15, | ||
4, | ||
19, | ||
35 | ||
] | ||
} | ||
} | ||
], | ||
metadata: { | ||
'geostyler:ref': { | ||
rules: [{ | ||
name: 'earthquake_circle', | ||
symbolizers: [ | ||
[ | ||
'r0_sy0_st0' | ||
] | ||
] | ||
}] | ||
} | ||
} | ||
}; | ||
|
||
export default expression_case; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { Style } from 'geostyler-style'; | ||
|
||
const gsExpressionInterpolate: Style = { | ||
name: 'Expression Interpolate', | ||
rules: [{ | ||
name: 'earthquake_circle', | ||
symbolizers: [{ | ||
kind: 'Mark', | ||
wellKnownName: 'circle', | ||
color: '#000000', | ||
fillOpacity: 0.6, | ||
radius: { | ||
name: 'interpolate', | ||
args: [{ | ||
name: 'linear' | ||
}, { | ||
name: 'property', | ||
args: ['population'] | ||
}, { | ||
stop: 12, | ||
value: 2 | ||
}, { | ||
stop: 15, | ||
value: 4 | ||
}, { | ||
stop: 19, | ||
value: 35 | ||
}] | ||
} | ||
}] | ||
}], | ||
metadata: { | ||
'mapbox:ref': { | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
sourceMapping: { | ||
testsource: [0] | ||
}, | ||
sourceLayerMapping: { | ||
foo: [0] | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default gsExpressionInterpolate; |
Oops, something went wrong.