Closed MangoChris closed 3 months ago
Thanks for the info @MangoChris and sorry for the late response.
Unfortunately, I cannot reproduce the error on my local setup.
How did you create the style in step 1? Is the value in the filter input numerical?
On my setup, following GeoStyler style
{
name: 'Small populated New Yorks',
rules: [{
filter: ['&&',
['==', 'NAME', 'New York'],
['==', 'TEST_BOOL', 'true'],
['==', 'TEST', null],
['*=', 'TEST2', '*York*'],
['*=', 'TEST1', '*New*'],
['!', ['>', 'POPULATION', '100000']],
['||',
['==', 'TEST2', '1'], // <----------------- string input
['>=', 'TEST2', 2] // <------------------- numeric input
]
],
name: 'Small populated New Yorks',
symbolizers: [{
kind: 'Line',
color: '#FF0000',
width: 3
}]
}]
}
creates the following mapbox style:
{
version: 8,
name: "Small populated New Yorks",
layers: [{
id: "Small populated New Yorks",
type: "line",
filter: ["all",
["==", "NAME", "New York"],
["==", "TEST_BOOL", "true"],
["==", "TEST", null],
["*=", "TEST2", "*York*"],
["*=", "TEST1", "*New*"],
["!", [">", "POPULATION", "100000"]],
["any",
["==", "TEST2", "1"], // <---------------- string input
[">=", "TEST2", 2] // <------------------- numeric input
]
],
paint: {
"line-color": "#FF0000",
"line-width": 3
}
}]
}
Closed due to inactivity. Feel free to reopen issue, if it is still relevant.
Bug
The filter value for number comparisons (=/</>/<=/>=) is being stored as a string rather than an integer in the mbtiles output. This causes the expressions to fail when loading in Mapbox GL.
To Reproduce Steps to reproduce the behavior:
Expected filter output
[ ">=", "Median income", 56390.333333333321207 ],
**Actual filter output:[ ">=", "Median income", "56390.333333333321207" ],