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

/*
 First, went to the RBC center website and got a map...
 http://www.rbccenter.com/documents/1058.png
 and saved it as ...  rbc_map.jpg
 I brought it up in the IE browser, and found the dimensions were 
 750 (horizontal pixels) x 519 (vertical pixels).
*/

/*
Dimensions of the image
*/
%let xsize=750;
%let ysize=519;

/*
Size of my output 
*/
%let xpaper=800;
%let ypaper=600;

/* Size of your output page */
goptions xpixels=&xpaper ypixels=&ypaper;


data blank_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;

/*
I got the X/Y coordinates for the center of each section by mousing-over
in Microsoft Paint.  I 'flip' the y-coordinate so it will match the SAS/Graph
gmap coordinate system.
*/
data interest;
length mylabel mydrill $ 500;
input section x y;
y=&ysize-y;
datalines;
  321      220     19
  322      260     19
  323      320     19
  324      380     19
  325      440     19
  326      500     19
  327      540     19
  328      580     39
  329      620     39
  330      660     79
  331      680     99
  332      720    159
  333      720    239
  334      720    319
  335      680    399
  336      660    419
  337      620    459
  338      580    459
  301      550    489
  302      500    489
  303      440    489
  304      380    489
  305      320    489
  306      250    489
  307      210    489
  308      170    469
  309      130    449
  310       90    419
  311       70    389
  312       50    349
  313       30    309
  314       30    249
  315       30    189
  316       50    149
  317       70    109
  318      100     79
  319      130     49
  320      170     29
  201      520    429
  202      460    429
  203      420    429
  204      380    439
  205      340    429
  206      290    429
  207      240    429
  208      180    409
  209      130    369
  210      100    329
  211       90    299
  212       80    249
  213       90    199
  214      100    169
  215      130    129
  216      170     89
  217      230     69
  218      290     59
  219      340     59
  220      380     59
  221      420     59
  222      460     59
  223      520     59
  224      580     89
  225      630    129
  226      660    189
  227      680    249
  228      670    309
  229      630    369
  230      580    409
  101      490    379
  102      460    369
  103      420    369
  104      380    379
  105      340    379
  106      300    369
  107      260    379
  108      210    369
  109      170    339
  110      150    309
  111      140    269
  112      150    229
  113      150    179
  114      180    149
  115      220    129
  116      260    119
  117      300    119
  118      340    119
  119      380    119
  120      420    119
  121      460    119
  122      500    119
  123      540    119
  124      580    149
  125      600    189
  126      610    219
  127      610    169
  128      600    299
  129      580    349
  130      540    369
;
run;
data interest; set interest;
   mylabel="How's the view from section "||trim(left(section))||" ?";
   mydrill="http://www.seatdata.com/html/nhl_hurricanes/section_nhl_hurricanes_"||trim(left(section))||".htm";
run;
data interest; set interest;
   length  function style color $ 8 html $ 1000;
   when='b';   xsys='2'; ysys='2'; hsys='3'; 
   /* Instead of a circular pie, you could annotate a rectangular polygon or
    something, but I choose the pie function because it centers exactly (as
    opposed to the annotated text labels using 'marker' font for dots),
    and it is also very easy to specify a pie. */
   function='pie';
   style='empty';
   color='white';  
   rotate=360;
   size=3;
   position='5';
   html=
   'title='||quote(trim(left(mylabel)))||
   ' href='||quote(trim(left(mydrill)));
run;
data image;
   length  function style color $ 8 html $ 1000;
   xsys='2'; 
   ysys='2'; 
   hsys='3'; 
   when='a';   /* draw the annotated image/map 'after' the gmap, so it's on top */
   function='move'; x=0; y=0; output;
   function='image'; x=&xsize; y=&ysize; imgpath='rbc_map.jpg'; style='fit'; output;
run;
data interest; set image interest;
run;

 
goptions device=png;
goptions border;
goptions cback=grayf7;

ODS LISTING CLOSE;
ODS HTML path=odsout body="&name..htm" (title="SAS RBC proof-of-concept") style=minimal;

goptions htitle=5pct htext=3pct ftitle="arial/bo" ftext="arial";

pattern1 v=s c=grayf7;

title1 ls=1.5 "RBC Center";
footnote "Click on seating section to see view from that section...";
proc gmap data=blank_map map=blank_map anno=interest; 
 id idnum; 
 choro idnum / coutline=grayf7 nolegend des="" name="&name"; 
run;
 
quit;
ODS HTML CLOSE;
ODS LISTING;
