How can you add an 'alt' tag to tile layers, and raise the accessibility score of an application, in particular to the Esri.WorldGrayCanvas, but any of the tiles found at http://leaflet-extras.github.io/leaflet-providers/preview/?
相关问题
- F#: Storing and mapping a list of functions
- How to get coordinates of an svg?
- NPE in StrutsTestCase after enabling Tiles
- In Tiles,Struts2 java.lang.NoClassDefFoundError: o
- Leaflet popups for specific base maps
相关文章
- change leaflet marker icon
- Why can't I pass const map structure to a func
- Prevent zooming out in leaflet R-Map?
- Scala: getting the key (and value) of a Map.head e
- Multiple markers on the exact same position on a L
- What happened when call std::map's operator[]
- YAML: dictionary with empty value
- leaflet how to make dynamic picture popup using js
You could manipulate the tile images when they load by hooking into the tileload event:
That way the images always have the alt tag, even after zoom/pan and you don't have to use Jquery.
A solution for the tiles to be accessible on the map load is listed below, however a solution for the tiles when zooming in/out has not been identified at this time.
Note: Since the solution below references jQuery, ensure you are referencing jQuery's JavaScript in your code.
After setting the basemap variable, e.g.:
Add a jQuery document ready function giving the Leaflet tile panes an attribute. Next trigger the function indicating that each map tiles will be referenced by 'Map tile image' and its index number.
Note: This solution only applies when the application loads and as soon as a user zooms/pans the alternative images will disappear.