MapML icon indicating copy to clipboard operation
MapML copied to clipboard

Questions about <layer hidden>

Open zcorpan opened this issue 5 years ago • 3 comments

hidden - Visibility status of the layer in the layer control

The hidden boolean attribute can be set to remove the layer from the map layer control, but it will remain displayed on the map. In order to remove the layer from the map display, it can be have its checked property toggled, or be removed from the DOM.

I find this attribute a bit weird. The hidden attribute is a global attribute in HTML, which mostly maps to 'display: none' rendering, and the semantic is that the element is not relevant in the page's current state. The layer here is rendered and so is probably relevant; just not selectable in the controls.

Why use hidden here?

zcorpan avatar Jun 29 '20 14:06 zcorpan

Why use hidden here?

I think because the word hidden had an existing use in HTML. There is the hidden boolean attribute, but there's also the <input type="hidden">, and perhaps the use of hidden here is a cross between them.

In any case, the intent was to signify that the layer would be present in the map (similar to the fact that is serialized in form submissions) but not visible in the layer control. A layer that behaves like this can be useful to reduce the cognitive burden on the user, since layers and their controls are/can be confusing to people.

prushforth avatar Jul 03 '20 19:07 prushforth

There is the hidden boolean attribute, but there's also the , and

@prushforth "there's also the", the what?

I do think hidden is a source of confusion. I find myself going back to look up what disabled, hidden and checked do, all too often.

Malvoz avatar Sep 28 '20 20:09 Malvoz

@Malvoz: there's also the <input type=hidden>. I failed to escape the element.

prushforth avatar Sep 29 '20 00:09 prushforth