Hit Map Tutorial
What I'm doing here is simply creating a modified version of the HTML code used
to generate the US map. Rather than go to the official site and fill in all the data from
scratch each time you want to update your map, it's easier to save the HTML code on your PC, and
then modify the HTML as needed in a way that will save your selections such as colors,
states selected, and labels for future use. Subsequent map updates, such as adding a new state, simply involve
modifying a few lines of HTML source code in the file on your PC, opening the file in your browser, and clicking
the "Draw the Map" button.
A little HTML terminology is necessary here for HTML newbies. Most of what needs to be done
to the HTML code is simply selecting options and adding attributes. All that mouse clicking and
filling in labels and titles on an HTML form can be done ahead of time by modifying the HTML code.
Whenever the instructions below say to "select an option", it
simply means to change <OPTION> to <OPTION selected>. That's right. Simply place the
cursor in your text editor after the word OPTION and add the word "selected" (don't forget the separating blank
space). To add an attribute, you add text of the form "attribute=value" to an HTML tag. For example,
adding the attribute "border=2" (border is the attribute, 2 is the value), to <IMG src="mypic.gif">
results in <IMG src="mypic.gif" border=2>
So here's the procedure:
-
Go to http://monarch.tamu.edu/~maps2 and click on the United States link.
-
Right click on the page and View Source. Save the source code somewhere on your PC in a new file,
such as "make_US_map.html". (Internet Explorer makes this easy as it opens Notepad when you
view the source. In Netscape you will probably have to sweep out the text, then copy and paste into
a text file using the word editor of your choice). Now to edit the HTML...
-
Change the line
<Form method=POST action="us.pl5"> to
<Form method=POST action="http://monarch.tamu.edu/~maps2/us.pl5">;
-
By default, you will get a map with state borders shown. If you don't want borders, find and select the following option
(see above if you forget how to select an option):
<OPTION>B. Showing no state lines (borders)
-
Further down you'll find a line that contains "Next, enter a title for your map:". To title your map, add a "value" attribute
to the INPUT tag on the next line. For instance I added value="Hits by State"
-
Now it's time to specify the state colors for up to 6 different groups. Find the SELECT tag named FILLCOLOR0 and its
corresponding OPTION list. Select the option corresponding to the color you want for your first group of states.
Repeat this step for the FILLCOLOR1 option list, etc., up to FILLCOLOR5, or as many groups as you plan to define.
-
To label each group, add a value="your label" attribute to the corresponding INPUT tag. For instance, the
first group's INPUT tag is <INPUT TYPE="TEXT" NAME="LABEL0" MAXLENGTH=20 SIZE=20>. Since my
first group of states is those having a single hit only, I added value="1 Hit". Modify the other INPUT tags for
as many other groups as you will have.
-
Further down you'll see an option list to select text color; if you want black do nothing, otherwise select the option
(color) you want for map text.
-
If you want to add a map note, look for the following:
Before selecting states, enter any text you wish to be used as "Notes":
<TEXTAREA NAME="LEGEND" ROWS=4 COLS=60 WRAP="PHYSICAL">
</TEXTAREA>
Adding text to a TEXTAREA is different than for an INPUT tag.
Put the text for your map note in between the opening and closing TEXTAREA tags.
For example:
<TEXTAREA NAME="LEGEND" ROWS=4 COLS=60 WRAP="PHYSICAL">
Currently have hit 13 out of 50 states, plus Canada and Puerto Rico
</TEXTAREA>
-
Now for the real time saver, selecting the states. Find the line
<SELECT MULTIPLE NAME="UNIT0" SIZE=10>
This is where you select all the states for group 1 (in my case, the ones that have just 1 hit). Simply
select each OPTION (state) you want included in group 1. Do the same thing for the states in the other groups by
finding the SELECT statements for UNIT1, UNIT2, etc.
You're done. Save the file with all your changes, making sure the file name ends
in .html (e.g. mapmaker.html). (Do not save the file
as .txt which is the default file type for Windows Notepad editor).
Then open the newly created HTML file using your internet browser. You should see
the form with all of your selections and labels you just added to the HTML file. Don't worry about
the missing graphics, and the hyperlinks won't work either, but that doesn't matter.
Now just click the "Draw the Map" button to generate the map.
This works for the state county maps as well. Follow the same procedure, starting by clicking on the
state link from http://monarch.tamu.edu/~maps2. The only tricky part will be changing the "action" attribute
in the FORM tag. The state maps don't all reside in the same directory, so you will have to determine the
directory from the browser's URL window and prepend that to the file given in the "action" attribute.
Back to top