%let name=supertitle;
filename odsout '.';

/* The alt= in the title is a new 9.4 feature */

data mydata;
format population comma12.0;
input statecode $ 1-2 population;
year=2000;
statename=fipnamel(stfips(statecode));
datalines;
VA  7078515
NC  8049313
SC  4012012
;
run;

proc sort data=mydata out=mydata;
by statecode statename;
run;

data mydata; set mydata;
length htmlvar $500;
htmlvar=
 'title='||quote(
  'State: '|| trim(left(statename)) ||'0D'x||
  'Population: '|| trim(left(put(population,comma12.0))))||
 ' href="http://www.state.'||trim(left(lowcase(statecode)))||'.us"';
run;


goptions device=png noborder;
 
ODS LISTING CLOSE;
ODS HTML path=odsout body="&name..htm" 
 (title="SAS/Graph ODS HTML Drilldown gmap") 
 style=sasweb;

goptions gunit=pct htitle=6 htext=4;

axis1 label=none;
axis2 label=none minor=none offset=(0,0);

pattern v=solid color=cx43a2ca;  

options nobyline;

title1 ls=1.5 "Drilldown Map for " 
 color=blue underlin=1
 link="http://www.state.#byval(statecode)..us" 
 alt="Click to drilldown to #byval(statename) home page"  /* alt= is a new 9.4 feature */
 "#byval(statename)";

footnote c=gray "GTitle has both html href= and alt=, populated with by-variable";

proc gmap data=mydata map=mapsgfk.us all; 
by statecode statename;
id statecode;
choro population / levels=1 nolegend
 coutline=gray33 
 html=htmlvar
 des='' name="&name._#byval(statecode)";  
run;

quit;
ODS HTML CLOSE;
ODS LISTING;
