Good Day,
I have a geojson(similar to below) and I am facing trouble with an expression that works well when used without promoted.
JSFiddle:
https://jsfiddle.net/dollysingh3192/w6bzsx84/7/
GeoJson
{
'type': 'FeatureCollection',
'features': [
{
"geometry": {
"type": "Point",
"coordinates": [
8.612079620361328,
-2.932969060251523
]
},
"type": "Feature",
"properties": {
"id": "GMYTEORRGI5DQ",
"sid": "s_133",
"n": "15",
"r": "13",
"s": "312",
"sz": 5.5,
"m": "n",
"ri": 13,
"si": 7
},
"id": 11578
}
]
}
Working
Below expression is working fine and extract one feature from Map(Without using promoteId)
mapInstance.queryRenderedFeatures({ layers: ['seat'], filter: ["any", ["==", ["id"], 21762]] });
Working GIF:
Not Working
But on using promoteId in geojson source, the expression is not working at all.
mapInstance.queryRenderedFeatures({ layers: ['seat'], filter: ["any", ["==", ["id"], "GMYTEORRGI5DQ"]] });
Not Working GIF:
However, I noticed that setFilter and setFeatureState work fine with the same expression.
mapInstance.setFilter('seat', ["match", ["id"], "GMYTEORRGI5DQ", true, false]); //Works fine
GIF with setFilter:(Don't know why it works). LINK
Please guide. Am I doing anything wrong here?
https://jsfiddle.net/dollysingh3192/w6bzsx84/7/