%let name=bo_s; filename odsout '.'; /* I'm using long/lat locations from my Garmin 2610 GPS unit */ goptions reset=global; /* To see the original wake county map, run the following from the sas command line: gis map=maps.wake.bg Liz Simon converted that map to a sas map dataset for me some time ago, and that's the map I'm using here. */ /* Modify Liz's x/y Map Data Set values to make them like maps.states */ libname here '.'; data wake; set here.wake; /* Convert Liz's x/y values to long/lat degrees */ longitude=-1*(x/10000000); /* change values like -786399000 to 78.6399000 */ latitude= y/10000000; /* change values like 357834000 to 35.7834000 */ /* Now, convert the long/lat degrees to Radians (so we can 'gproject' them) */ x=atan(1)/45 * longitude; y=atan(1)/45 * latitude; run; /* Now, use sas/gis geocoding to calculate long/lat of the addresses */ data locations; input name $ 1-19 address $ 21-49 city $ 51-63 zip long_degree long_minute lat_degree lat_minute ; state="NC"; plus4=0; mytag="address_layer"; cards; Bojangles 3808 Western Blvd Raleigh 27606 78 41.326 35 47.092 Bojangles 1209 Laura Village Dr Apex 27502 78 50.104 35 44.924 Bojangles 2620 Atlantic Ave Raleigh 27604 78 36.958 35 49.057 Bojangles 1013 New Bern Ave Raleigh 27601 78 37.435 35 46.796 Bojangles 4405 Falls Of Neuse Rd Raleigh 27609 78 36.768 35 50.548 Bojangles 3301 Washington St Raleigh 27603 78 38.944 35 44.134 Bojangles 5409 Capital Blvd Raleigh 27616 78 34.896 35 51.539 Bojangles 7525 US-64 E Knightdale 27545 78 28.654 35 47.940 Bojangles 1400 N Main St Fuquay-Varina 27526 78 46.424 35 35.554 ; run; data locations; set locations; length info $ 100; info=trim(left(address))||', '|| trim(left(city))||', '|| trim(left(state))||' '|| trim(left(zip)); /* Convert the degree & minutes to decimal degrees */ longitude = long_degree + (long_minute/60); latitude = lat_degree + (lat_minute/60); ; run; data locations; set locations; x=atan(1)/45 * longitude; y=atan(1)/45 * latitude; run; /* Create a red dot, with link & chart-tip for each regional office */ data markers; set locations; length function style color $ 8 position $ 1 text $ 20 html $1024; length mapquesturl $ 200; retain xsys ysys '2' hsys '3' when 'a'; anno_flag=1; mapquesturl= 'http://www.mapquest.com/maps/map.adp?'|| 'city='||trim(left(city))|| '&state='||trim(left(zipstate(zip)))|| '&address='||translate(trim(left(address)),'+',' ')|| '&zip='||trim(left(zip))|| '&country=us&zoom=7'; /* This is the flyover text & drilldown */ html='title='||quote( trim(left(info)) )||' href='||quote(mapquesturl)||' '; /* red star */ function='label'; text='V'; position='5'; size=3.9; color='CXc60000'; style='marker'; output; /* Now, a slightly bigger white outline */ size=5.1; color='white'; style='markere'; output; /* Use the 'empty' marker font, to make colored outline around the letter */ size=3.9; color='black'; style='markere'; output; run; /* Combine the map & annotation dataset(s), so you can project them together */ data work.combined; set wake markers; run; /* project the map, and the annotation data set. When x/y are in longitude/latitude, they must be 'projected', or your map will look squished & backwards. */ proc gproject data=work.combined out=work.combined dupok; id tract bg; run; /* Now, split the map & annotation apart again */ data markers wake; set work.combined; if anno_flag=1 then output markers; else output wake; run; data img; length function text $ 8; length color $ 8; xsys='3'; ysys='3'; hsys='3'; when='A'; html='title="Bojangles Home Page" href="http://www.bojangles.com" '; function='move'; x=10; y=68; output; function='image'; x=x+18; y=y+10; imgpath='bojangles.gif'; style='fit'; output; run; GOPTIONS DEVICE=png; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" style=minimal; goptions cback=CXffde00 border; goptions gunit=pct htitle=6 htext=3 ftitle="arial/bold" ftext="arial"; title1 ls=1.5 c=CXc60000 "Bojangles' Restaurant Locations"; title2 h=6 f="arial/bold" c=CXc60000 "Wake County, NC"; footnote c=CXc60000 "Click on star markers to see 'mapquest' locations."; pattern1 v=s c=red r=1000; proc gmap data=wake map=wake anno=markers; id tract bg; choro tract / nolegend discrete anno=img coutline=CXffde00 des="" name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;