%let name=depot; /* Using Home Depot floorplan map from: http://assi-cad.com/depot.html */ /* Size (proportions) of your map gif file */ %let xsize=635; %let ysize=458; goptions xpixels=635 ypixels=458; goptions xpixels=1000 ypixels=800; /* Size of invisible annotated pie/dot's on the grid */ %let piesize=.8; data depot_map; idnum=1; x=0; y=0; output; x=symget('xsize'); y=0; output; x=symget('xsize'); y=symget('ysize'); output; x=0; y=symget('ysize'); output; run; /* Now, create an annotate datasets containing a "grid of dots" that you can overlay on top of the map, and when you mouse over the dots you'll see the x/y coordinates of that area of the map... */ data circles; length function $ 8 style color $ 12 html $ 1000 text $ 50; xsys='2'; ysys='2'; hsys='3'; when='b'; function='move'; x=0; y=0; output; function='image'; x=&xsize; y=&ysize; imgpath='hdr2.jpg'; style='fit'; output; /* now, do the grid of pies */ function='pie'; style='empty'; color='cyan'; rotate=360; position='5'; size=&piesize; do x=0 to &xsize by 10; do y=0 to &ysize by 10; html='title="X='||trim(left(x))||' Y='||trim(left(y))||'"'; output; end; end; run; /* Use category abbreviations - this will save typing later, and also make it easier to pass these in the sas/intrnet url's and the macro variables (otherwise, there could be problems with special characters such as ', &, *, etc). Now, when passing parameters to sas/intrnet, I can use the 'cat' and/or the 'spacenum', which are both simple/short text. */ data cats; input cat $ 1-5 category $ 7-37; datalines; app Appliances books Books bldg Building Supplies clean Cleaning & Janitorial decor Decor elect Electrical fauct Faucets floor Flooring gardn Garden Center hand Hand Tools hrdwr Hardware hvac Heating & Cooling kitch Kitchen & Bath light Lighting & Fans oliv Outdoor Living opwr Outdoor Power Equipt paint Paint and Supplies plumb Plumbing ptool Power Tools safe Safety & Security stor Storage & Organization ; run; data depot_items; input x y spacenum $ 11-16 cat $ 18-22 store $ 24-80; datalines; 289 290 P23a app Maytag Washer 430 130 G2f6 books Farmers Almanac 80 180 Q1f bldg 8ft 2x4s 240 180 Bf2c clean Simple Green Cleaner 250 240 k517 decor Draperies 450 330 E578 elect Dimmer Switch 310 300 F328 fauct Kohler Faucet 380 230 L23k floor Pergo Flooring 520 210 GG12 gardn Hydrangea 140 170 H23x hand DeWalt Drill 200 260 F9A6 hrdwr 2in Zinc Lag Bolt 220 380 Z231 hvac 10x20in AC filter 190 290 Pj3k kitch Toilet Flapper 380 190 C5 light Ceiling Fan 430 230 GR58 oliv Weber Grill 450 180 LL90 opwr Homelite Chain Saw 335 260 C23L paint Wagner Power Painter 140 200 PL25a plumb Teflon Tape 150 160 H001 ptool HUSKY 1/2in Impact Wrench 210 180 Cx28 safe Master Lock 2in Padlock 290 200 A14y stor ClosetMaid Shoe Rack ; run; /* Now, merge in the category names, based on the 'cat' category abbreviation */ proc sql; create table depot_items as select * from depot_items left join cats on depot_items.cat = cats.cat; quit; run; data depot_items; set depot_items; length mydrill $ 500; length function $ 8 style color $ 12 html $ 1000 text $ 80; /* do a google search on the product (this could be a link to home depot's page for this product instead) */ html= 'title='||quote( trim(left(store))|| ' ')|| ' '|| 'href='||quote( 'http://www.google.com/search?hl=en&q='||trim(left(store))||' '); when='a'; xsys='2'; ysys='2'; hsys='3'; position='5'; /* a star character from the sas/graph 'marker' software font */ color='white'; function='label'; style='marker'; text='V'; size=3; output; style='markere'; color='cyan'; output; /* And, a label for this marker */ color='white'; position='c'; angle=45; size=2.75; function='label'; style='"arial/bo"'; text=' '||trim(left(store)); html=''; output; /* */ run; /* This is the annotated image of the floorplan picture */ data depot_pic; length function $ 8 style color $ 12 html $ 1000; xsys='2'; ysys='2'; hsys='3'; when='a'; function='move'; x=0; y=0; output; function='image'; x=&xsize; y=&ysize; imgpath='hdr2.jpg'; style='fit'; output; run; filename odsout '.'; GOPTIONS DEVICE=png; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="SAS Prototype - Virtual Home Depot") style=minimal gtitle gfootnote ; goptions ftitle="arial" ftext="arial" htitle=6pct htext=3pct ctitle=white ctext=white; goptions cback=black; proc sql; create table interest as select * from depot_items; quit; run; title link="http://www.homedepot.com" "Home Depot (Cary, NC)"; title2 font='marker' color=white 'V' font="arial" color=white "= location of items on your shopping list"; proc gmap data=depot_map map=depot_map anno=depot_pic; id idnum; choro idnum / nolegend anno=interest coutline=black des="" name="&name"; run; /* title "Now, adding a grid of annotated circles/pies"; title2 "(mouse over the circles to see the x/y coordinates of that area)"; proc gmap data=depot_map map=depot_map anno=depot_pic; id idnum; choro idnum / nolegend anno=circles coutline=black des="" name="&name"; run; */ quit; ODS HTML CLOSE; ODS LISTING;