Strange Issue.
I have the some code that queries a database and prases the results.
$MAP_OBJECT = new GoogleMapAPI(); $MAP_OBJECT->_minify_js = isset($_REQUEST["min"])?FALSE:TRUE;
//$MAP_OBJECT->setDSN("mysql://user:password@localhost/db_name");
// Make a MySQL Connection
$query = "SELECT * FROM `gpsdata`";
$result = mysql_query($query) or die(mysql_error());
$print = '$MAP_OBJECT->addMarkerByCoords';
while($row = mysql_fetch_array($result)){
$long = $row['longitude'];
$lat = $row['latitude'];
$router = $row['routername'];
$desc = $row['desc'];
$div = $row['div'];
echo ("$print($long,$lat,\"$router-$desc\", \"$router-$desc<br><a href=\"./$div/$router\">Site Info</a>\");");
}
This is what a result looks like.
$MAP_OBJECT->addMarkerByCoords(-79.064250,67.175501,"xxx-SITE", "xxx-SITE<br><a href=\"./riv/xxx\">Site Info</a>");
If I manually create the entry the icon appears on the map. If I run the following query the results just print on the screen, nothing on the map. All of this takes place before the header info.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Not sure what to do, I have tried a few things, all with the same result.
You may be echoing out your statements before any templating has been done.
If you add:
above:
This will turn output buffering on – and may sort the issue out