thanks, Ross K.
I  am  trying  build  the   map  route   with  a  polyline  between
the   first  and  last  point stored  in   the   database.  It
persists   an  error   not   displaying   the   polyline only   the
map   of   zone  here --http://djalmabina.100webspace.net/googleMaps78/
track.php
I  don't   know   if   my  array  defined  for   points   is
correct.
This  code  that  is:
 <body>
<div id="map" style="width: <?php echo $map_width ?>px; height: <?php
echo $map_height ?>px">
</div>

<script type="text/javascript">
//<![CDATA[
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(<?php echo $initial_lat ?>, <?php echo
$initial_lon ?>), <?php echo $initial_zoom ?>);
<?php
$link = mysql_connect($dbserver, $username, $password)
  or die("Could not connect: " . mysql_error());

mysql_select_db($dbname,$link) or die ("Can\'t use database : " .
mysql_error());

$sql = "SELECT lat,lng FROM geo_points WHERE route=1";

$result = mysql_query($sql,$link);
if (!$result)
{
  //echo "no results";
}

while($row = mysql_fetch_array($result))
{
  $points = array();
  $numpoints = sizeof($points);
  echo "var polyline = new GPolyline([";
  for ($i = 0; $i <= ($numpoints - 1); $i++) {
    $coordinates = explode(",",$points[$i]);
    echo "new GLatLng(" . $coordinates[1] . "," . $coordinates[0] .
")";
    if ($i != ($numpoints - 1)) {
      echo ",\n";
    } else {
      echo "\n";
    }
  }
  echo "],\"#ff0000\", 8);\n";
  echo "map.addOverlay(polyline);\n\n";
}

mysql_close($link);
?>

//]]>
</script>
</body>
 Some   variables   above  are   defined  in  another  config  file.
   thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to