I've got a relational dataset broken into two layers: members and organizations. They're GeoJSON, with features that look something like this:
// Org Features
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-78.34998, 37.784]
},
"properties": {
"id": 46391,
"name": "A Big Organization",
"lifetime_profiles": 7013,
"present_profiles": 49
}
}
// Member Features
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-80.99998, 47.7624]
},
"properties": {
"id": 21446,
"given_name": "John",
"family_name": "Doe",
"orgs": [21437, 117028]
}
}
I want to show which members are linked to which organizations when I click on the map. I'm trying to do so using the following filter:
const handleClick = (target) => {
const bbox = [
[target.point.x - 5, target.point.y - 5],
[target.point.x + 5, target.point.y + 5]
];
const opt = { layers: ['orgs'] };
const targetIDs = map.queryRenderedFeatures(bbox, opt).map((feature) => {
return feature.properties.id;
});
// find clicked orgs
map.setFilter('users', ['in', 'orgs', ...targetIDs]);
};
From my earlier research, I've gathered that the "in"
filter is deprecated now. How can I accomplish this aim using current filters?