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
Currently the keydown event handler is not working for maplibre. I realize maplibre may not be officially supported, but MapboxDraw mostly works with it. The problem is that the keydown handler currently looks for a CSS class on the canvas, in a specific order in classList:
if ((event.srcElement || event.target).classList[0] !== 'mapboxgl-canvas') return; // we only handle events on the map
In maplibre, they've added an additional class in front of that one, so that the canvas class is: "maplibregl-canvas mapboxgl-canvas", which causes the check above to bail out of handling the events.
So, my question is, would you take a pull request that changes the above line of code to something along the lines of !classList.contains('mapboxgl-canvas') instead? Or it could even look for either of the two above classes. I'm not sure how long maplibre is planning to keep around the mapbox CSS classes.
Currently the keydown event handler is not working for maplibre. I realize maplibre may not be officially supported, but MapboxDraw mostly works with it. The problem is that the keydown handler currently looks for a CSS class on the canvas, in a specific order in classList:
taken from here: https://github.com/mapbox/mapbox-gl-draw/blob/main/src/events.js#L130
In maplibre, they've added an additional class in front of that one, so that the canvas class is: "maplibregl-canvas mapboxgl-canvas", which causes the check above to bail out of handling the events.
So, my question is, would you take a pull request that changes the above line of code to something along the lines of !classList.contains('mapboxgl-canvas') instead? Or it could even look for either of the two above classes. I'm not sure how long maplibre is planning to keep around the mapbox CSS classes.
maplibre/maplibre-gl-js#2006
maplibre-gl-js version: 2.4.0
mapbox-gl-draw version: 1.3.0
Steps to Trigger Behavior
Expected Behavior
Polygon is deleted
Actual Behavior
Polygon is not deleted
The text was updated successfully, but these errors were encountered: