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
{{ message }}
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
Map mouse events and their callbacks drive a large amount of 3rd party behavior in MapboxGL maps. I think the DOM nodes generated by mapbox-gl-accessibility should also inherit event callback behavior from the source features.
For example, if my map displays some zoning information, and I bind a click handler for each zone, the DOM nodes should also have click handlers bound to them...
Thoughts on this? A few drawbacks:
Possibility of double-firing events
Handlers might not stay in sync if un/binding occurs later
const{ id }=feature.layer;constlayer=map.getLayer(id);SUPPORTED_MAPBOX_MOUSE_EVENTS.forEach(event=>{feature.marker[`on${event}`]=(e)=>{constcanvas=this.map.getCanvasContainer();canvas.dispatchEvent(newMouseEvent(event,{bubbles: true,clientX: position.x,clientY: position.y,}));};});
I tried to use the sorta private/sorta public map.fire event but it's finicky. This approach is also finicky and I don't know why. Here's what I'm observing: DOMNode.click on the ARIA node works great, but after I do a "real" click, subsequent DOMNode.clicks no longer trigger the mapbox-gl event.
Activity
allthesignals commentedon Jan 26, 2020
https://www.w3.org/TR/WCAG20-TECHS/SCR35.html
Anyone have thoughts on this? I have some sloppy code demo'ing how this might work.
allthesignals commentedon Jan 26, 2020
I see, @andrewharvey has an excellent & thorough list of objectives here, this issue is one them :):
allthesignals commentedon Jan 26, 2020
One approach:
I tried to use the sorta private/sorta public
map.fireevent but it's finicky. This approach is also finicky and I don't know why. Here's what I'm observing: DOMNode.click on the ARIA node works great, but after I do a "real" click, subsequent DOMNode.clicks no longer trigger the mapbox-gl event.