Sorry for my English.
I have data on mapbox in vector tiles.
I made a function where a user can select a plot and validate with a button. I get the parcel ID. When clicked on the button, the map is updated and only the plot polygon is colored using a filter :
map.addLayer({
'id': 'parcelle-data-highlighted',
'type': 'fill',
'source': 'centremapbox',
'source-layer': 'centremapbox',
'paint': {
'fill-outline-color': '#3c3c3b',
'fill-color': '#afca0b',
'fill-opacity': 0.75
}
});
map.setFilter('parcelle-data-highlighted', [
'in',
'ID_PARCEL',
''+ parcel +''
]);
It works !
Then, I don't understand how to retrieve the coordinates of the polygon that I have colored via the filter. I tried things with map.queryRenderedFeatures and map.querySourcesFeatures but I only get empty data.
Can someone explain to me the procedure to follow, despite the doc, I can't do it. My goal is to retrieve the coordinates to zoom in on them.
Thank you very much for your help.
Olivier