[Bug] getCursor Inside MapboxOverlay Always Receives isDragging as false
Description
There seems to be an issue with the getCursor function inside MapboxOverlay. The isDragging parameter passed to getCursor always evaluates to false, regardless of whether the map is being dragged or not. This is incorrect and prevents proper updates to the cursor during map dragging.
here is my code
map = new maplibregl.Map({
container: mapElement.value,
style: darkmode.isDark ? styleDarkMap : styleMap,
center: [INITIAL_VIEW_STATE.longitude!, INITIAL_VIEW_STATE.latitude!],
zoom: INITIAL_VIEW_STATE.zoom,
bearing: INITIAL_VIEW_STATE.bearing,
pitch: INITIAL_VIEW_STATE.pitch,
transformRequest: (url: any, resourceType: any) => {
if (isMapboxURL(url)) {
return transformMapboxUrl(url, resourceType, token)
}
// Do any other transforms you want
return {
url,
// credentials: "include" // Include cookies for cross-origin requests
}
},
})
deckOverlay = new MapboxOverlay({
getCursor: ({ isDragging }) => {
console.log(isDragging)
return 'pointer'
},
})
map.addControl(deckOverlay)
Flavors
- [X] Script tag
- [ ] React
- [ ] Python/Jupyter notebook
- [X] MapboxOverlay
- [ ] GoogleMapsOverlay
- [ ] CartoLayer
- [ ] ArcGIS
Expected Behavior
The isDragging value should reflect whether the map is being dragged. When the map is dragged, isDragging should be true. Otherwise, it should be false.
Steps to Reproduce
1- Initialize a maplibregl.Map with a MapboxOverlay control. 2 - Implement a getCursor function that logs or inspects the isDragging parameter. 3 - Interact with the map by dragging it. 4 -Notice that isDragging always logs as false, even during dragging.
Environment
- Framework version: [email protected]
- Browser: Chrome 131.0.6778.86
- OS: window 10
Logs
No response
Just curious: does getCursor actually work in MapboxOverlay? I would think you need to change the cursor through the base map APIs.
for me its not working at all , can you tell me what you mean when you say "change the cursor through the base map APIs" ?
This sounds indirectly related to https://github.com/visgl/deck.gl-community/pull/203#issuecomment-2632714140 regarding how MapboxOverlay does not properly handle events.