GEOG5870/1M: Web-based GIS A course on web-based mapping

The basic google map (which is fully commented) is taken from Harvard Uni Google Maps Tutorial. Explore this resource, it's a good refresher on what we have covered.

Copy the code below and paste it in into your file directly after line 36. This code will draw a red line from California to Maine to Texas.

//Begin add polyline code
var polyLineCoordinates = [
   new google.maps.LatLng(37.4419,-122.1419),
   new google.maps.LatLng(45.65654,-71),
   new google.maps.LatLng(28.65654,-100),
];
var polyLine = new google.maps.Polyline({
   path: polyLineCoordinates,
   strokeColor: '#FF0000',
   strokeOpacity: 1.0,
   strokeWeight: 2
});
polyLine.setMap(map)
// End of add polyline code

Have a look at the map - have the lines appeared?

You should have something like this:

Text