%let name=nws; filename odsout '.'; /* Subset maps.county, and get just the counties of interest */ data work.county; set maps.county (where=(state=37)); proc sql; create table work.my_data as select unique state, fipstate(state) as st, county from work.county where (state=37 and county in ( 47 19 129 141 17 163 51 85 183 77 181 185 69 83 127 131 91 73 29 53 55 139 143 41 15 187 177 55 95 13 137 49 31 103 133 61 101 191 107 147 117 65 195 79 155 ) ) ; /* Get the county names */ create table work.my_data as select my_data.*, cntyname.countynm from work.my_data left join maps.cntyname on my_data.state=cntyname.state and my_data.county=cntyname.county; quit; run; /* Create html chart tips for county names */ data work.my_data; set work.my_data; length myhtmlvar $200; county6=substr(lowcase(countynm),1,6); myhtmlvar= 'title='|| quote( trim(left(countynm))||' county, '||trim(left(st))||' ')||' "'; run; data work.city_anno; input city $ 1-26 labelpos $ 28 link $ 30-49 longitude latitude; cards; Duck C IsabelDuck 75.74 36.18333 Oregon Inlet Marina C IsabelOregonInlet 75.55 35.796667 Hatteras Fishing Pier F IsabelCapeHatterasFP 75.635 35.22333 Beaufort D IsabelBeaufort 76.671667 34.716667 ; run; /* For these links to work, you must have access to the internet */ data work.city_anno; set work.city_anno; length html $ 1000; html=' title="'||trim(left(city))||'"'|| ' href="http://www.erh.noaa.gov/mhx/Images/'||trim(left(link))||'.gif"'; x=atan(1)/45 * longitude; y=atan(1)/45 * latitude; run; /* Create annotate 'dot' label for the city */ data work.city_anno; length function style color $ 12 position $ 1 text $ 30 html $1024; retain xsys ysys '2' hsys '3' when 'a'; set work.city_anno; anno_flag=1; /* output a dot for the city */ function='PIE'; size=1.25; position='5'; line=0; angle=0.0; rotate=360.0; color='yellow'; style='SOLID'; output; color='black'; style='EMPTY'; output; /* output a label for each city (containing city & state)*/ color='black'; function='label'; size=2.5; text=' '||trim(left(city)); position=labelpos; style='"arial"'; output; run; /* project the map */ data work.combined; set work.county work.city_anno; run; proc gproject data=work.combined out=work.combined dupok; id state; run; data work.county work.city_anno; set work.combined; if anno_flag=1 then output work.city_anno; else output work.county; run; /* Define a template, to get the graphic above the map ... */ ods path work.template(update) sashelp.tmplmst; proc template; define style styles.nws; parent = styles.default; /* Put the graphic above the title */ style Body from Document / prehtml = "
" ; /* replace color list with something, so that gray background is over-ridden, and white is used */ replace colors / "link1" = color_list("green") ; end; run; GOPTIONS DEVICE=gif; goptions xpixels=800 ypixels=500; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Weather Map") style=nws nogtitle nogfootnote; goptions noborder; goptions cback=white; pattern1 c=white v=s repeat=100; title f="arial/bold" h=.3in j=c "Coastal Water Level Rises Associated"; title2 f="arial/bold" h=.3in j=c "with Hurricane Isabel"; title3 f="arial" h=.15in j=c "(click on a Location to Display a Graph)"; footnote1 f=swiss h=.15in j=c "Note: Duck Readings Likely Too High When Gauge Broke,"; footnote2 f=swiss h=.15in j=c "and Cape Hatteras Fishing Pier was Still on the Rise when it Broke."; footnote3 " "; /* footnote4 f=swiss h=.15in link="http://www.erh.noaa.gov/mhx/IsabelCoastal.html" "Made to imitate http://www.erh.noaa.gov/mhx/IsabelCoastal.html"; */ proc gmap map=work.county data=work.my_data anno=work.city_anno imagemap=work.a2; id state county; choro state / html=myhtmlvar nolegend coutline=gray55 discrete woutline=2 des="" name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;