Click here to see the SAS code.
Click here to see the example.
I am a "car guy" - I really like classic cars & sports cars.
I volunteer DJ for a lot of the car shows in our area, that
raise money for charities. So, it stands to reason that I spend
a lot of time surfing the web looking at the various cars-for-sale
websites. And, being a "graphics" guy, I wanted to see if I could
make that surfing a little easier and more user-intuitive :-)
I wrote this little example to help me look through the autotrader
website for Corvettes...
First I select the largest city from each county, in the maps.uscity
data set. I then merge in a zipcode for that city, from the
sashelp.zipcode data set. I then turn this list of cities into
an annotate data set, where I create a "dot" for each city
(using the annotate "pie" function).
I use the annotate's "html" variable to code in title= charttips/
flyover-text showing the name of the city & state, and I code in
an href= drilldown that will query the autotrader.com website
and search for corvettes within 100 miles of that location.
One difference here from some of my other maps - I use the already-
projected maps.us, since I'm using the already-projected maps.uscity
locations (rather than starting with the unprojected long/lat and
having to combine the map & annotate, and project it, and then
separate them again before drawing the map).
I put the 'autotrader.com' logo at the top of the map by annotating
the autotrader logo gif file, and I add an href link to take you to
the autotrader homepage if you click on the logo. I add the blank
space at the top of the map for this logo by using a blank title
that with a height of 8% of the page.
Now, what would be *really* neat, is if I could hook this into the autotrader
database, and generate a map that showed the actual dots only where there
are actual cars (and maybe where there were multiple cars in the same
city it would color-code the dot to indicate how many matches) - now *that*
would be really neat! :) ... but since I don't have direct access to
their database, I can't set up that kind of map :\ This idea would be
*very* do-able -- it would just have to have the sas servers set up on
the autotrader website, and use sas/access to directly query their data,
and use sas/intrnet to dynamically draw the chosen map (you could let the
user choose make/model/year-range/price-range/etc, and then draw the
map with the matching data).
Back to Samples Index