The USGenWeb Project News
Volume 5, Number 1
Creating County Maps with Google Maps API
by Joy Fisher
I created my first Google map from scratch:
I started out by going to the Geonames Server
and collecting a list of all the cemeteries in their database for Union Co., SD. I carefully converted
all the latitude and longitude from degrees, minutes and seconds to decimal degrees. I created a
template for adding a map marker for each cemetery, including a link to my cemetery file for that
cemetery. Lastly I created a boundary file with the latitude and longitude of all the points that make
up the county boundary. The boundary file was generated by going to
Topozone and clicking on the boundary on their maps and
noting the latitude and longitude, moving a short distance and clicking again. For a nice rectangle,
you only need the coordinates of the 4 corners, but Union Co. has 2 rivers as boundaries and lots of
points were needed on those two sides.
I shared my code with some of my friends including David Crosby, resident computer guru for the
USGenWeb Archives. He created a program that automatically generated much of what it took me
several days to do manually. Like most computer gurus, David worked on the program until it
worked to his satisfaction and then moved on to other projects. Using what David has created
and with his permission, I created a user friendly interface for the program.
The final result is made available to
USGenWeb volunteers. You choose the state and county to generate a Google map and a geographic
feature you want to have map markers placed on the map. After clicking the "Create Map" button,
the results page is a little confusing. Some temporary files are generated so the final ready to
use files can be generated. Ignore the stuff at the top of the file and scroll down to the bottom
of the page.
Right click on the three files at the bottom and save them to your computer. These files will
only work if you upload them to your RootsWeb account. Upload all 3 into the same folder on
RootsWeb and then open you browser to http://www.rootsweb.ancestry.com/~youraccount/yourfolder/countymap.html.
To use the files at any other site, you will need to get an
API key from Google. Edit the
countymap.html file and replace the RootsWeb API key with the one you get for your domain.
Note you do not need separate APIs for each county at that domain.
For information regarding adding links to files about the locations, adding other locations,
and editing the xml file, see the help file.
My thanks to David for doing all the hard work on this utility. I have used it for many of my
counties and I hope you find it useful too.