Maps4HTML / MapML.js

A custom <mapml-viewer> and <layer-> element suite
https://maps4html.org/MapML.js/
Other
57 stars 16 forks source link

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

Open prushforth opened 7 months ago

prushforth commented 7 months ago

If a \ contains a \, 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 \ and \.

The \ 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 \, but \ would be the "batteries-included" default, which would help accessibility I think.

AliyanH commented 7 months ago

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 commented 7 months ago

There are going to be challenges, but it should be possible to have a default rendering heuristic perhaps. For example, a \ 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 commented 7 months ago

For consideration https://en.wikipedia.org/wiki/Automatic_label_placement