Witam wszystkich próbuje zrobić plik kml za pomocą przykładowego kodu z Google Earth, zawartość pliku jest poprawna jednak marker nie otwiera się w programie problem polega na tym że plik kml zaczyna się od trzeciego a nie pierwszego wiersza, używam krasnal serv. Jeśli ktoś wie co jest nie tak będę wdzięczny za pomoc
<?php
header('Content-type: application/vnd.google-earth.kml+xml'); require('phpsqlajax_dbinfo.php');
// Opens a connection to a MySQL server.
if (!$connection)
{
}
// Sets the active MySQL database.
if (!$db_selected)
{
}
// Selects all the rows in the markers table.
$query = 'SELECT * FROM markers WHERE 1';
if (!$result)
{
}
// Creates an array of strings to hold the lines of the KML file.
$kml = array('<?xml version="1.0" encoding="UTF-8"?>'); $kml[] = '<kml xmlns="http://earth.google.com/kml/2.1">';
$kml[] = ' <Document>';
$kml[] = ' <Style id="restaurantStyle">';
$kml[] = ' <IconStyle id="restuarantIcon">';
$kml[] = ' <Icon>';
$kml[] = ' <href>http://maps.google.com/mapfiles/kml/pal2/icon63.png</href>';
$kml[] = ' </Icon>';
$kml[] = ' </IconStyle>';
$kml[] = ' </Style>';
$kml[] = ' <Style id="barStyle">';
$kml[] = ' <IconStyle id="barIcon">';
$kml[] = ' <Icon>';
$kml[] = ' <href>http://maps.google.com/mapfiles/kml/pal2/icon27.png</href>';
$kml[] = ' </Icon>';
$kml[] = ' </IconStyle>';
$kml[] = ' </Style>';
// Iterates through the rows, printing a node for each row.
{
$kml[] = ' <Placemark id="placemark' . $row['id'] . '">';
$kml[] = ' <name>' . htmlentities($row['name']) . '</name>'; $kml[] = ' <description>' . htmlentities($row['address']) . '</description>'; $kml[] = ' <styleUrl>#' . ($row['type']) .'Style</styleUrl>';
$kml[] = ' <Point>';
$kml[] = ' <coordinates>' . $row['lng'] . ',' . $row['lat'] . '</coordinates>';
$kml[] = ' </Point>';
$kml[] = ' </Placemark>';
}
// End XML file
$kml[] = ' </Document>';
$kml[] = '</kml>';
$kmlOutput = join($kml ,"\n"); //header('Content-type: application/vnd.google-earth.kml+xml');
?>