I'm trying to set up a GPS routes map, however it is not display
any map.
Firebug on Mozilla keeps telling me those 2 errors :
1. - a has no properties
http://maps.google.com/intl/pt-BR_ALL/mapfiles/126d/maps2.api/main.js
Line 289
2.- this.bf has no properties
http://maps.google.com/intl/pt-BR_ALL/mapfiles/126d/maps2.api/main.js
Line 744
My map here is --
http://djalmabina.100webspace.net/html/track.php?route=3
I am trying to do this call with some PHP loop
structures to get several routes stored in MySql database.
My PHP and JS sources are these :
<script type="text/javascript">
//<![CDATA[
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.enableGoogleBar();
map.enableDoubleClickZoom();
map.enableScrollWheelZoom();
map.setMapType(G_HYBRID_TYPE);
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
<?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());
$route = $_GET['route'];
$pontos = Array();
$numpoints = count($pontos);
$sql ="SELECT * FROM geo_points WHERE route='$route'";
$result = mysql_query($sql);
if(mysql_num_rows($result)==0){
echo "Route not found!";
exit;
}
else {
foreach($pontos as $rota) {
$route = $r['route'];
$pontos[$route][]= "new GLatLng(".$r['lat'].",".
$r['lng'].")";
while($r = mysql_fetch_row($result))
{
for ($i = 0; $i <= ($numpoints - 1); $i++)
{
echo "map.setCenter(new GLatLng(".$pontos[$i]->lat.",".$pontos[$i]-
>lng.",".$initial_zoom."))";
echo "var pano_layer = new PanoramioLayer(map);\n";
echo "pano_layer.enable();\n";
echo "var point = new GLatLng(".$pontos[$i]->lat.",".$pontos[$i]-
>lng.");\n";
echo "var marker = createMarker(point);\n";
echo "map.addOverlay(marker);\n";
echo "var polyline = new GPolyline([".implode(",\n",$rota[$i])."],
\"#ff0000\", 5, 1);";
echo "map.addOverlay(polyline);\n";
}
}
}
}
mysql_close($link);
?>
//]]>
</script>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---