mapbox-gl-accessibility icon indicating copy to clipboard operation
mapbox-gl-accessibility copied to clipboard

Automatically choose layers based on source layers

Open 1ec5 opened this issue 8 years ago • 2 comments

The iOS implementation in mapbox/mapbox-gl-native#9950 automatically chooses style layers to query based on the source layers they render. On iOS, we hard-code Mapbox Streets source v7 layers that correspond to information that would be labeled on a standard map:

https://github.com/mapbox/mapbox-gl-native/blob/dcd7da14f6627a09a5840a3046b5708449962f69/platform/darwin/src/MGLStyle.mm#L758-L774

I can see an argument for letting the developer choose which style layers to make accessible. That could be useful for data vis maps, which are less common on mobile platforms. Still, choosing a sensible set of style layers based on a sensible set of source layers would alleviate the developer from having to figure out all the layer IDs in their style, which can be a pretty tedious affair.

/cc @tristen

1ec5 avatar Nov 17 '17 02:11 1ec5

I think a sensible set of layers that align with Streets or other core styles is a good idea. This could be an option in the plugin (choose a default).

I do like the option of a developer choosing the layers to make accessible but that could be secondary to ^. It also provides a mechanism for custom source layers added: accessibility can easily be applied to them as well.

tristen avatar Nov 17 '17 14:11 tristen

That could be useful for data vis maps

I think a sensible set of layers that align with Streets or other core styles is a good idea. This could be an option in the plugin (choose a default).

:+1: In the projects I've implemented hidden accessible HTML Elements sitting on top of the symbol or circle layers, it's always been for cluster circles or marker pins (using Symbol) which sit on top of the base map.

So I think for a lot of use cases, an app might choose to only make the markers they add on top of the standard basemap accessible.

andrewharvey avatar Apr 29 '18 00:04 andrewharvey