You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on developing a JavaScript solution to add the alt attribute to images in map popups. Using the events listed in this repo's readme, I cannot get consistent results when changing between webmaps. I have tried the code in different topic.subscribe sections within the custom-scripts.js file.
Is there an event that fires when the webmaps change? I'll provide my sample code below. Any help is greatly appreciated:
letwebmap=app.map;webmap.on('click',function(){// only execute code if a popup is displayed on clickif(webmap.infoWindow.isShowing){// img elements within the feature popupletpopupImage=document.querySelectorAll('div.image > img')[0];if(typeofpopupImage!=='undefined'){// popup title - bridge nameletbridgeNameElement=document.querySelectorAll('div.esriViewPopup > div.mainSection > div.header')[0].innerHTML;// add alt attribute using bridge's namepopupImage.setAttribute('alt',bridgeNameElement);// || 'some string'}}});
The text was updated successfully, but these errors were encountered:
I am working on developing a JavaScript solution to add the
alt
attribute to images in map popups. Using the events listed in this repo's readme, I cannot get consistent results when changing between webmaps. I have tried the code in differenttopic.subscribe
sections within thecustom-scripts.js
file.Is there an event that fires when the webmaps change? I'll provide my sample code below. Any help is greatly appreciated:
The text was updated successfully, but these errors were encountered: