I want to access my map instance to use methods not exposed thru the plugin currently.
Particularly I want to click on a heatmap that has featurecollections and return those features within x pixels of my click. In the mapbox.js docs they say to using something like this
map.on('click', (e) => {
// Set `bbox` as 5px reactangle area around clicked point.
const bbox = [
[e.point.x - 5, e.point.y - 5],
[e.point.x + 5, e.point.y + 5]
];
// Find features intersecting the bounding box.
const selectedFeatures = map.queryRenderedFeatures(bbox, {
layers: ['counties']
});
//do more stuff with the selectedFeatures
});
But I can’t find the method queryRenderedFeatures. So I was trying to access the map instance to do it myself via code.
Is that possible?