-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
Description
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
- Script tag
- React
- Python/Jupyter notebook
- 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: deck.gl@9.0.36
- Browser: Chrome 131.0.6778.86
- OS: window 10
Logs
No response