Puedes probar algo así:
Código PHP:
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(11111,22222),11);
var opciones_poligono = {geodesic:true};
var puntos = [];
<?php
foreach( $points as $point ) {
echo "puntos.push( new GLatLng($point[0], $point[1]) );\n";
}
?>
var polyline = new GPolyline(puntos);
map.addOverlay(polyline);
}
}
window.onload=load
//]]>
</script>
Tu variable $puntos tiene que ser un arreglo donde cada elemento sea un arreglo de dos elementos para x y y:
Código PHP:
$puntos = array();
$puntos[0] = array( val_x, val_y );
Saludos.