Skip to content
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

Use <map-featurecaption> as the feature label and accessible name by default #947

Open
prushforth opened this issue Mar 23, 2024 · 3 comments
Labels
accessibility basic styling Elements should only have basic and native-like styling (W3C TAG Components Guideline) enhancement help wanted needs discussion user preferences Allow user to set a remembered value across domains

Comments

@prushforth
Copy link
Member

prushforth commented Mar 23, 2024

If a <map-feature> contains a <map-featurecaption>, the feature should be visually labelled, using map text label defaults built into the user agent stylesheet, amended by the user stylesheet and potentially customized by the server-provided style rules found in <map-link rel=stylesheet> and <map-style>.

The <map-geometry> should be used to control the label placement algorithm.

If a feature is tiled into parts, it should be possible to merge the geometry parts using a standard attribute name which has a common value across the parts. The label placement algorthim could use the resulting re-assembled geometry as required.

CSS rules could be used to substitute content to be rendered in place of <map-featurecaption>, but <map-featurecaption> would be the "batteries-included" default, which would help accessibility I think.

@prushforth prushforth added enhancement help wanted accessibility user preferences Allow user to set a remembered value across domains needs discussion basic styling Elements should only have basic and native-like styling (W3C TAG Components Guideline) labels Mar 23, 2024
@prushforth prushforth changed the title Use <map-featurecaption> as the feature label by default Use <map-featurecaption> as the feature label and accessible name by default Mar 23, 2024
@AliyanH
Copy link
Member

AliyanH commented Apr 4, 2024

As discussed, possible overlapping problems may exist with this approach:

image

Similarly, when zoomed out, we will face the issue of improper label size since no media query exists yet to incorporate map scale which would be used to adjust size accordingly.
image

@prushforth
Copy link
Member Author

There are going to be challenges, but it should be possible to have a default rendering heuristic perhaps. For example, a <map-feature> has a zoom attribute aka native zoom, and perhaps we could limit the default rendering to that zoom value.

As far as overlapping labels goes, yes, this would require some label collision detection logic to be built into the renderer I guess.

Good to keep discussing what might be involved for now.

@prushforth
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility basic styling Elements should only have basic and native-like styling (W3C TAG Components Guideline) enhancement help wanted needs discussion user preferences Allow user to set a remembered value across domains
Projects
None yet
Development

No branches or pull requests

2 participants