This codelab will challenge you to become familiar with the various features of the Google Maps Javascript API- from basics like markers to more advanced topics like driving directions - while learning to use various sections of the documentation. At the end of this codelab, you'll have a full interactive map.
-
Create a map centered on a university campus (e.g. your alma mater).
Class Reference:GMap2, Developer's Guide: Hello World, Tutorial: Your First Map
-
Add a map type control and a zoom control to the map.
Class Reference: GMap2, Developer's Guide: Adding Controls to the Map
-
Add a traffic overlay to the map.
Class Reference: GTrafficOverlay, Developer's Guide: Traffic Overlays
-
Add a marker at the map center.
Class Reference: GMarker, Developer's Guide: Markers
-
Make it so that an info window opens with your university motto when you click on the marker.
Class Reference: GEvent, Class Reference: GMarker, Developer's Guide: Event Listeners, Tutorial: Your First Map
- Add a logo of the university mascot to the info window.
-
Find a small logo for your university via google image search, and make it the icon for the marker using GMarkerOptions.
Class Reference: GMarkerOptions, Developer's Guide: Icons
-
Make it so that the icon image for the marker changes on mouseover to a different logo using
GMarker.setImage.
Class Reference: GMarker
-
Create a "My Map" of a few of your favorite local restaurants on google maps, then overlay it on your map using
GGeoXml and the KML output.
Class Reference: GGeoXml, Developer's Guide: KML/GeoRSS Overlays
-
Draw a polyline on the map from your apartment to one of your classrooms.
Class Reference: GPolyline, Developer's Guide: Polylines Overview
-
Add driving directions for your house to your favorite local restaurant on the map.
Class Reference: GDirections, Developer's Guide: Driving Directions
-
Create an XML file that contains at least 3 placemarks (with name, description, and latitude/longitude information). Use
GDownloadUrl to read the XML file into your page, and then display a marker for each one.
Class Reference: GDownloadUrl, Developer's Guide: XML and Data Parsing
-
Make it so that an info window opens up with a name and description whenever one of those markers is clicked.
-
Create a GPolyline that goes through each marker.
Class Reference: GPolyline
-
Report the length of that polyline under the map using GPolyline.getLength.
Class Reference: GPolyline