I have been playing around with mapbox-gl. I am trying to get the map to flyTo()
a specific polygon in one of my layers.
After looking extensively through the API I can only find methods to return features after clicking the map or selecting with a bounding box — no method to parse the features of a layer and its attributes.
I want the latlon (or bounding box or whatever) of a polygon in the dataset, where “NBHD_NAME” equals the variable I am searching for. I am using a polygon PBF hosted on Mapbox. I cannot seem to access the features of the vector layer through map.getLayer()
or map.getSource()
.
Am I missing something obvious, or is this functionality not really present in mapbox-gl?