I load a Leaflet JS based map at launch of my website. I have no problems with creating, displaying maps and other operations, it opens very fast 92% average speed result
But in the google pagespeed results, it breaks points because the alt image tag is not loaded on these map images, and when you add it, it loads the alt tag for that many photos at the opening and opens a little later and lowers the score this time.
Example Jquery code;
$(document).on('ready', function(){
addMapTileAttr('.leaflet-tile-pane img')
});
function addMapTileAttr(styleClass) {
var selector = $(styleClass);
selector.each(
function(index) {
$(this).attr('alt',"Map tile image " + index);
});
}
Is the alt tag mandatory on these images specifically on the map? What's the best practice move for this?