You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
importtype{MapRef}from'react-map-gl';importMAP,{FullscreenControl,GeolocateControl,NavigationControl,Popup,ScaleControl}from'react-map-gl';constMapboxMap: React.FC=()=>{consthandleMapClick=(event)=>{constmap=mapRef.current.getMap();constfeatures=map.queryRenderedFeatures(event.point);console.log('Features:',features);// Returns empty array when clicking on map features};return(<MapmapStyle="mapbox://styles/mapbox/standard"onClick={handleMapClick}// ... other props>{/* map contents */}</Map>);
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
The text was updated successfully, but these errors were encountered:
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
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
The text was updated successfully, but these errors were encountered: