Questions about <layer checked>
checked - Layer on/off status
The display state (on / off) of the content represented by the layer element is controlled by the checked boolean attribute and corresponding property. If checked, the layer is drawn on the map in the sequence it is found in the parent element; if not checked the layer is not drawn but should remain visible in the map element's representation of controls in an "unchecked" state.
Is it the common case to have layers off by default? Why was checked chosen here?
I find it a bit weird to have the display state of a layer represented by the presence/absence of checked.
Is it the common case to have layers off by default?
Mostly not. You make a good point that the default state should be checked, so maybe a better choice would be unchecked, but that's a double negative which is confusing.
Why was
checkedchosen here? I find it a bit weird to have the display state of a layer represented by the presence/absence of checked.
checked is a state keyword in html already, and it conveys the state of the layer in the layer control. In designing the <video><source src="x"><source src="y"></video> construct provides (automatic) choice selection (one-of-these-sources, analagous to a set of radio inputs) for the user based on their device's preferences, and how a <map><layer src="x"></layer><layer src="y"></layer><map> could provide interactive user selection of layers (anyof-these-layers, like a set of checkbox inputs) via representation of the layers in the layer control.
checkedis a state keyword in html already, and it conveys the state of the layer in the layer control.
While that's the intention, I think per the spec it actually means that the layer element itself has a checkedness, and not the representation (input element) in the exposed user interface.
I suppose you could tailor the definition(s) in regards to MapML, but I think doing so for existing attributes, such as in this case, may become somewhat of a nightmare for implementers/WHATWG spec editors. Imagine all the places things have to change to accommodate for special handling in MapML.
But looking at the Priority of Constituencies we should ask; is this sane for developers? If you ask me, it isn't. I think minting new attributes "make things better for multiple constituencies at once".
In my opinion we should re-evaluate disabled, hidden and checked. I'd love to hear what others think. Maybe it is time (as @zcorpan suggested) to raise a WHATWG HTML issue to get some feedback on the spec.
raise a WHATWG HTML issue to get some feedback on the spec
Although, quite a few elements are missing fundamental descriptions, so it could be hard for reviewers to give any meaningful feedback in some cases.
https://github.com/Maps4HTML/MapML/issues/70:
datalist,label,select,option: ?
Re the priority of constituencies, the user comes first, so these attributes and properties are intended to reflect the common interactions users have with layers. Open to improvement, though. They do reflect my understanding at the time, but I would be open to discussion, especially with WHATWG.
Nothing changes for the user, I agree that an input element is appropriate in the exposed user interface, but not with the method that makes it available to the user.
How would you tackle it?
Sorry, I meant I don't agree with re-using the attribute names, that's all.
I understand, but if it's only about what the attributes are named, and not what they do, what would be better names?
GeoMoose used status="(on|off)".
Another idea: inactive boolean attribute to inactivate layers as opposed to checked for activating.
Either way I agree that it makes sense that layers are "active"/"on" by default.