Click here to see the SAS code.
Click here to see the example.
I start with the maps.states US map, since it has long/lat boundaries,
and I can therefore combine it with the long/lat coordinates of the
nuclear plants and have them show up in the correct location.
I use a user-defined format to make the numeric values for the number
of nuclear plants in each state show up as the desired value range
in the legend - also each range gets a color in the map.
I use a bunch of 'if' statements to create custom html title= charttips/
flyover-text for each state. These multi-line chart tips show all the
nuclear plants in the state, when you hover your mouse over the state.
(Each state has a different number of plants, so each charttip has a
different number of lines -- I think this is the only example I have
that does this).
I then create a data set with the zipcode & web address of each nuclear
plant. I merge in the long/lat location for the zipcode, using the
sashelp.zipcode data set. I use the annotate 'pie' function to draw
the red/white nuclear-looking markers, using 6 pie wedges, and
alternating between red & white.
I combine the annotate data set with the map, and then gproject them
both together, and then separate them again. By projecting them
together, that guarantees that the annotation will line up in the
exact correct position on the map.
I create another annotate data set with the state abbreviations
(nothing new here - this is done in many examples).
Then I create a map of the entire US, with the internal boundaries
gremoved, and convert that into a gray annotate polygon. I draw
this map before/behind the real map, and offset it a little, and
it looks like a 'shadow' behind the map.
Since I have multiple annotate datasets, I use two anno= -- one in
the proc gmap line, and one as an option in the gmap (this is a little
more convenient than combining all the annotate together into a single
annotate data set).
Back to Samples Index