MapML icon indicating copy to clipboard operation
MapML copied to clipboard

How will layer.disabled be used?

Open zcorpan opened this issue 5 years ago • 1 comments

The disabled property is a read-only boolean indicator of the visibility of the layer on the map.

How is this property expected to be used? I can't tell if a disabled IDL attribute is the "right" API, or if there should be a state IDL attribute, error/load events, or other.

If the layer is not visible due to errors, including projection, zoom or extent mismatch, the property will be true and if the layer is present in the layer control (i.e. hidden is false), it will be disabled in that control i.e. not checkable.

This is pretty vague, but hints at some error handling. This should be well-defined.

zcorpan avatar Jun 29 '20 15:06 zcorpan

The disabled property is a read-only boolean indicator of the visibility of the layer on the map.

How is this property expected to be used? I can't tell if a disabled IDL attribute is the "right" API, or if there should be a state IDL attribute, error/load events, or other.

Currently, we are working (in the web-map-custom-element) on setting the layer disabled state based on the notional 'visibility' of the layer in the map: if the layer content bounds intersects the map's bounds and the layer's declared valid zoom range intersects the zoom value of the map, the layer is not in the disabled state; otherwise the layer is in the disabled state (can't be interacted with, checked or other state changed) in the layer control; the layer control text for the layer appears in italic font, and a screen reader would be informed of the disabled state and read it out to the user when it was focused in the layer control).

I don't think this precludes error / load events, or other events.

If the layer is not visible due to errors, including projection, zoom or extent mismatch, the property will be true and if the layer is present in the layer control (i.e. hidden is false), it will be disabled in that control i.e. not checkable.

This is pretty vague, but hints at some error handling. This should be well-defined.

Good idea. Currently in the web-map-custom-element, we are working on setting layer.error when something bad happens (404 'etc'). Unsure if this is the right approach, or API. Needs discussion!

prushforth avatar Jul 03 '20 18:07 prushforth