queryRenderedFeatures is not working on latest Mapbox Standard Map style
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: ^3.8.0
**browser**: Any browser
### Steps to Trigger Behavior
Create a new map instance using the Mapbox Standard style
Add click handler that uses queryRenderedFeatures()
Click on various map features (buildings, roads, POIs)
Check console output or handler results
### Link to Demonstration
React Example
```tsx
import type { MapRef } from 'react-map-gl';
import MAP, { FullscreenControl, GeolocateControl, NavigationControl, Popup, ScaleControl } from 'react-map-gl';
const MapboxMap: React.FC = () => {
const handleMapClick = (event) => {
const map = mapRef.current.getMap();
const features = map.queryRenderedFeatures(event.point);
console.log('Features:', features); // Returns empty array when clicking on map features
};
return (
{/* map contents */}
);
```
### Expected Behavior
Clicking on map features (buildings, roads, POIs) should return an array of features with their properties
Should work similarly to how it works with 'streets-v12' style
### Actual Behavior
queryRenderedFeatures() returns an empty array when clicking on map features
No features are detected even when clicking on visible map elements
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided React example and reproduce the empty results using the Mapbox Standard style and queryRenderedFeatures() in the click handler. Compare the behavior with the streets-v12 style while inspecting which visible map features are available to query. Done means clicks on visible buildings, roads, and POIs return feature objects with their properties.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100