Click here to see the SAS code.
Click here to see the example.
This is the updated (2005) version of the old democd1 regional office map.
This is basically a US map, with red dots (annotated pies)
at the locations of our sas offices, and also annotated state
abbreviations, and for the icing on the cake I have annotated
a black "shadow" of the us behind the map.
How did I do all this?...
For each office, I got the city longitude/latitude location
of that office's zipcode from the sashelp.zipcode data set.
I then created an annotate data set, and combined it with
the maps.states sas/graph map data set (you can't use maps.us
because it doesn't have long/lat coordinates). I then use
"proc gproject" to project the long/lat coordinates of the
map and the red dots into a rectangular area that will look
good as a map. I separate the annotate dots from the rest
of the map, so I can use "proc gmap" and have the map=
and the anno= separate.
Similarly, I do about the same thing for the state abbreviations,
except I get the location for these from the maps.uscenter data set,
rather than the sashelp.zipcode.
The "shadow" of the us is also annotate, but a little trickier.
First, I take the maps.states data set, and I "gremove" all the internal
boundaries of the states, so I just have one map area for the whole
country. Then I create an annotate "polygon" of that area, and color
it black. When I draw the map, I use when="b" for this annotated
gray polygon, so it gets drawn before (ie, behind) the real map.
And, I give it a little bit of offset in the X & Y direction, so that
it will look like a shadow.
One nice touch, I code in some drilldowns for the red dots, so you
can click on them and go to that office's website. And you can hover
your mouse over the red dots to see what city they're in. I do this
by creating an "html" variable in the annotate data set, and putting
title= charttips, and href= drilldown in this variable. I also put
drilldowns on the states, so you can drilldown to that region page.
Note that all of the Regional Office url's are on the external web
(where customers can see them), but the region pages you get when
you click on a state are on the internal sas web.
Back to Samples Index