-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add optional prop to set aria-label on OL canvas element in shadow root
#445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -217,6 +217,9 @@ export class MyMap extends LitElement { | |
| }, | ||
| }; | ||
|
|
||
| @property({ type: String }) | ||
| ariaLabelOlFixedOverlay = ""; | ||
|
|
||
| // set class property (map doesn't require any reactivity using @state) | ||
| map?: Map; | ||
|
|
||
|
|
@@ -629,6 +632,10 @@ export class MyMap extends LitElement { | |
| }); | ||
| } | ||
|
|
||
| // Add an aria-label to the overlay canvas for accessibility | ||
| const olCanvas = this.renderRoot?.querySelector("canvas.ol-fixedoverlay"); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's two
So,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good point to flag and I think I know why you're getting inconsistent results. My understanding is that OpenLayers doesn't generate either a single canvas, or canvas per-layer, but rather adds additional canvases as needed for memory/rendering. I'm trying to find some sort of reference to this online and nothing yet to confirm this in writing! Looking through OpenLayers examples and inspecting the DOM you can see maps with multiple layers on a single canvas, and some spread over multiple canvases. What might be best here is trying to select all
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dev call resolution here:
|
||
| olCanvas?.setAttribute("aria-label", this.ariaLabelOlFixedOverlay); | ||
|
|
||
| // XXX: force re-render for safari due to it thinking map is 0 height on load | ||
| setTimeout(() => { | ||
| window.dispatchEvent(new Event("resize")); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.