Google Maps

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Wednesday, November 09, 2005

Campus Google Map Applications

Robert Workman Adam Gschwender


Southern Connecticut State University Southern Connecticut State University
Workmanr1@southernct.edu GschwenderA1@southernct.edu
Jian Lian Chan
Southern Connecticut State University
Chanj2@southernct.edu
ABSTRACT
Google maps are panable and zoomable and customizable. Clickable markers open
information windows that can contain text, pictures, links, and reference to other
applications. Campus applications include mapping the location of admission applicants,
and maps giving the location and customized driving directions to off campus events.

1. INTRODUCTION
Web based Google maps can be used to visually display individual data points or
thousands of data points when grouped. Individual data points can be used to answer
questions like, where are the away football games, or where are NERCOMP events. The
sample application in this paper shows the location universities in the Connecticut State
University System (CSU). Info windows are displayed when a campus marker is clicked.
The info window in this example includes a picture, a link, and a driving directions
request. Campus grouped data applications include mapping where students came from or
where alumni work. Both types of maps will be discussed in this paper as well as how
to create info windows.

Documentation for creating customized Google Maps may be found at


http://www.google.com/apis/maps/documentation/. This documentation contains
information about how to obtain a key that is required for the Google Map to work.
There are also some simple examples that show how to create Google Maps as well as
several more complex examples. Another section of this site is devoted to an Application
Programmer Interface (API) overview.
------------------------
Copyright Robert Workman 2006 This work is the intellectual property of the
author. Permission is granted for this material to be shared for non-commercial,
educational purposes, provided that this copyright statement appears on the
reproduced materials and notice is given that the copying is by permission of the
author. To disseminate otherwise or to republish requires written permission from
the author..
2. FEW DATA POINTS WITH INFO WINDOW DISPLAYS
Data for maps with a few markers such as the map shown in Figure 1 can be created by
hand coding XML data. A link to a web page that displays this map may be found at
http://home.southernct.edu/~workmanr1/GoogleMapLinks.htm#Figure_1 (Links to
Google Maps). An example of the XML data is shown in Figure 2. This XML generator
program is needed when there are many data points. The data format is self
documenting. The values of lat and lng are the latitude and longitude of a point.
Programs known as geocoders are used to convert mapping points, such as zip codes or
street addresses, into latitudes and longitudes. Another example of data in the marker
record is href whose value is a link that will be displayed in the info window. Another
example is image. The value of image is a link to an image that will be displayed in
the info window. A link to a customized marker can be placed after icon=. See Links
to Google Maps for a link to the entire .XML file. These marker records will be used by
the mapping program.
http://home.southernct.edu/~workmanr1/GoogleMapLinks.htm#Figure_2

Figure 1: Map of the universities in the Connecticut State University (CSU) system. When a
marker is clicked an info window with graphics, links and a request form for driving instructions is
displayed

<markers>
<marker lat="41.329194" lng="-72.942844" name="SCSU" address="501
Crescent St. New Haven, CT 06515" href="http://www.southernct.edu/"
image="../graphics/scsu.jpg" height="140" width="112"
icon="../graphics/markers/marker-s.png" />
<marker lat="41.690799" lng="-72.771141" name="CCSU" address="1615
Stanley Street, New Britain, CT 06050" href="http://www.ccsu.edu/"
image="http://chronicle.com/jobs/profiles/icons/677/677image.jpg"
height="140" width="199" icon="../graphics/markers/marker-c.png" />
</markers>

Figure 2: XML data used to create the CSU map with info windows.

3. CREATING A MAP FROM A FILE WITH THOUSANDS OF DATA POINTS


Figure 3 shows a map that contains grouped data. Grouping data is important for making
the maps more readable and reducing rendering time. The input data used by the map is
the zip codes of some Southern Connecticut State University graduate students. The
steps used to create the map are shown below. A link to the mapping program may be
found at Links to Google Maps.
http://home.southernct.edu/~workmanr1/GoogleMapLinks.htm#Figure_3.
The XML generator program written in that created the marker data may be seen at
http://home.southernct.edu/~workmanr1/GoogleMapLinks.htm#Figure_4. The program
can be further customized to select a subset of an entire file. For example a map of only
students in a specified major or full time or part-time students could be created. The
steps used to create a grouped data map are shown in Figure 5.

Figure 3: Map using demonstration data showing students by Zip Code. When a marker is clicked
an info window displays the zip code and the number of students from that zip code.

1) XML data program


a) Input - student zip codes file.
b) Process - Create Google Map input data
i) Convert zip codes to latitude and longitude
ii) Group students by zip code
iii) Create a number attribute that will be used by the map program for selecting
marker icons.
c) Output XML records
2) The Google Map program
a) Input - XML data file
b) Processing
i) Create map data points
ii) Select appropriately colored icon for each marker
iii) Create info windows
c) Output - Google Map
Figure 4: Steps used to create a grouped data Google Map.

Figure 4 shows the users input screen of the program that reads in zip codes in comma
separated format (CSV) The program then groups data into numeric categories, assigns
colored markers to each category, and looks up the map coordinates for each zip code,
and creates XML records. This data is read and displayed by Google map.

Figure 5: Front end of the XML generator program used to create input data.

4. CONCLUSION

There are many university applications for Google Map. Two types of applications have
been presented in this paper. Data for maps with only a few markers can be created using
a text editor. For maps with lots of data a program is required to group data and to create
color coded marker. Map or data output from these programs have been shown. Links to
working programs maybe found at
http://home.southernct.edu/~workmanr1/GoogleMapLinks.htm

5. REFERENCES

Google Maps API Documentation - http://www.google.com/apis/maps/documentation


Google Map Mania - http://googlemapsmania.blogspot.com
Geocoder.us: a free US address geocoder - http://geocoder.us
WorldKit geocoder : - http://brainoff.com/worldkit/geocoder

Appendix A: Links to Google Maps Links to Google Maps


http://home.southernct.edu/~workmanr1/GoogleMapLinks.htm

Links - Links to Google Maps - Links to Google Maps - #Figure_3

Figure 1. Map of the schools in the Connecticut State University (CSU) system. An info
window is displayed when a marker is clicked. Google Maps:::CSU System Campuses -
http://www.southernct.edu/class/csc208a/maps/ctschools.html
Figure 2. XML data used to create the CSU map with info windows.
http://www.southernct.edu/class/csc208a/data/ctschools.xml
Figure 3. Map using demonstration data showing students by Zip Code.
http://www.southernct.edu/class/csc208a/maps/grad.php
Figure 4. XML generator program used to create input data.
http://www.southernct.edu/class/csc208a/data/xml_generator.phps.

Google Maps API - http://www.google.com/apis/maps/documentation/

You might also like