
function GoogleMapPointsAndLine()
{
	var	maxLat=-90,
			maxLon=-180,
			minLat=90,
			minLon=180;

	for (var i=0; i<mapData.points.length; ++i)
	{
		maxLat=Math.max(maxLat,mapData.points[i].lat);
		maxLon=Math.max(maxLon,mapData.points[i].lon);
		minLat=Math.min(minLat,mapData.points[i].lat);
		minLon=Math.min(minLon,mapData.points[i].lon);
	}

	var map=new GMap2(document.getElementById(mapData.id));

	// G_NORMAL_MAP displays the default road map view
	// G_SATELLITE_MAP displays Google Earth satellite images
	// G_HYBRID_MAP displays a mixture of normal and satellite views
	// G_DEFAULT_MAP_TYPES contains an array of the above three types, useful for iterative processing.
	// G_PHYSICAL_MAP displays a physical map based on terrain information.
	map.setMapType(G_HYBRID_MAP);

	map.setCenter(new GLatLng((maxLat+minLat)/2,(maxLon+minLon)/2),mapData.zoom);
	map.setUIToDefault();

	for (var i=0, points=[]; i<mapData.points.length; ++i)
	{
		var point=new GLatLng(mapData.points[i].lat,mapData.points[i].lon);

		if (mapData.markers)
			map.addOverlay(new GMarker(point,{title:mapData.points[i].title,clickable:false}));

		if (mapData.line)
			points[i]=point;
	}

	if (points.length)
		map.addOverlay(new GPolyline(points,mapData.lineColor,mapData.lineWidth));
}


if (GBrowserIsCompatible())
	google.setOnLoadCallback(GoogleMapPointsAndLine);
//else
//	alert("Sorry, your browser is not compatible with Google Maps.");

