%let name=onmouseover; filename odsout '.'; /* http://www.irt.org/script/118.htm */ proc sql; create table coindata as select unique state from mapsgfk.us; quit; run; data coindata; set coindata; length drillurl picurl mouseovercmd $500; st=fipstate(state); statename=lowcase(fipnamel(state)); linkname=translate(trim(left(statename)),'-',' '); drillurl='https://www.usmint.gov/coins/coin-medal-programs/50-state-quarters/'||trim(left(lowcase(linkname))); picurl='https://www.states101.com/img/quarters/large/'||trim(left(linkname))||'.png'; mouseovercmd="MakeAnotherWindow('https://www.states101.com/img/quarters/large/"||trim(left(linkname))||".png',230,430)"; length rollover $800; rollover= 'href='||quote(trim(left(drillurl)))|| ' title='||quote(trim(left(statename)))|| ' onMouseOver='||quote(mouseovercmd); run; goptions device=png; ods listing close; ODS HTML path=odsout body="&name..htm" (title="onmouseover example" no_bottom_matter) style=sasweb; goptions gunit=pct htitle=4 htext=3; title1 ls=1.5 "Mouse Over States to see State Quarter!"; title2 "(if your popups are disabled, use 'Ctrl+mouseover')"; footnote 'OnMouseOver calling custom javascript function in a SAS/Graph gmap'; pattern v=solid color=cx43a2ca; proc gmap data=coindata map=mapsgfk.us (where=(state ^= stfips('PR'))); id state; choro state / levels=1 nolegend coutline=black html=rollover des='' name="&name"; run; /* proc print data=coindata; run; */ quit; ods html close; filename foo "&name..htm" mod; DATA _NULL_; file foo; put ''; put ''; put ''; RUN; ods html close;