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 }}
Repository navigation
Re-design what mapml-viewer does with LegendURL / GetLegendGraphic links #524
WMS and other OGC mapping services provide legend information via linked graphics, typically but not necessarily images.
In the original implementation of this custom element, I wasn't sure what to do with this information, but I wanted to expose it, so I included a <a href="LegendURL">Layer name/title/label</a> in the <details>'<summary> that represents the layer in the layer control.
It seems possible that browsers will in future disallow such interactive content in the <summary> elements, so this issue is where we can discuss and design what to do with the (set of possible) LegendURL or GetLegendGraphic links (or equivalents) that may be available for a map layer. Currently these can be represented by DOM elements such as
At LEAST, the legend graphic for the <map-layer> should be rendered into a disclosure widget beneath the layer Opacity disclosure widget, before the sub-layers.
There's a related problem, however in that a map layer often has more than a single style, and for each style one can have at least one legend graphic, if not more than one due to support for multiple formats. png, jpeg, svg etc. Given that the style of a map is currently under the control of a <map-select> value, we must think of how to assign a legend link dynamically as the user changes selection. Perhaps <map-link rel="legend" tref="...style={style}.." > within a parent '`. tbd
I think I favour the disclosure widget approach. At some point I think we'll want to have a parameterized Legend (by style, principally) underneath Sub-layer, so a disclosure widget seems portable to that location as well. I've been working on a legend example for gcds-map, and I realized that opening a plain image in another tab doesn't do much for non-visual users (to understate it).
Activity
prushforth commentedon Jan 28, 2026
At LEAST, the legend graphic for the
<map-layer>should be rendered into a disclosure widget beneath the layerOpacitydisclosure widget, before the sub-layers.There's a related problem, however in that a map layer often has more than a single style, and for each style one can have at least one legend graphic, if not more than one due to support for multiple formats. png, jpeg, svg etc. Given that the style of a map is currently under the control of a
<map-select>value, we must think of how to assign a legend link dynamically as the user changes selection. Perhaps<map-link rel="legend" tref="...style={style}.." >within a parent '`. tbdAliyanH commentedon Jun 30, 2026
Hi @prushforth,
I played around with three possible placements for legend graphics, would love to hear your thoughts!
Option 1 - Legend appears in the layer settings, as a disclosure widget beneath layer Opacity disclosure widget

Option 2 - Legend appears in the layer settings, before the Opacity disclosure widget in a div

Option 3 - Legend appears outside the layer settings beneath the layer title, and is displayed as soon as the layer menu is opened

prushforth commentedon Jun 30, 2026
I think I favour the disclosure widget approach. At some point I think we'll want to have a parameterized Legend (by style, principally) underneath Sub-layer, so a disclosure widget seems portable to that location as well. I've been working on a legend example for gcds-map, and I realized that opening a plain image in another tab doesn't do much for non-visual users (to understate it).
Thanks for tackling this!