esri-leaflet-legend icon indicating copy to clipboard operation
esri-leaflet-legend copied to clipboard

Add support for alt text for legend images

Open pmacMaps opened this issue 5 years ago • 5 comments

I've added an alt property to the legend images. I'm using the label property.

I also added a second map service to the example that has label values set.

pmacMaps avatar May 29 '19 15:05 pmacMaps

Thanks a lot for your PR, do you think we can fix the localisation issue there?

w8r avatar May 31 '19 11:05 w8r

I removed the English text in the alt attribute, and now only reference the label property from the map service. This still helps with web accessibility (assuming there is a label for the map layer).

I still think it would be cool to add a constructor option to set default alt text. I tried, but failed to figure it out. And anyway, it is your call if you would even want that.

Thanks for the feedback.

pmacMaps avatar May 31 '19 15:05 pmacMaps

I suggested a way to pass the alt string template, do you want to add it? I can merge without it though, if you don't have time

w8r avatar May 31 '19 20:05 w8r

I did try something similar to what you proposed. But I kept getting jshint errors and the files wouldn't build.

I don't know when I'll be able to dig into this further, so I would be fine if you merge it as is.

pmacMaps avatar May 31 '19 22:05 pmacMaps

Did you want to merge it as is? Even though we want to add in the user-defined alt template text. This will at least provide a basic level of the alt attribute.

pmacMaps avatar Jul 12 '19 15:07 pmacMaps