php_geoclasses

phpGoogleKML - php class for creating Google KML file

author : Thailon 2007, hosted by misovic.net
[phpGoogleKML release notes] [phpGoogleKML sample] [phpGoogleKML style sample] [phpGoogleKML source] [phpGoogleKML documentation] [phpGoogleKML download]
HOWTO use phpGoogleKML class
<?
require("phpGoogleKML.php");

// a.) create instance of phpGoogleKML class
$my = new phpGoogleKML();

// b.) Change these properties only in case when you'd like to change default values (see documentation for default values).
$my->encoding 'Windows-1211';
$my->xmlns '2.0';
$my->KML_name 'kml name';
$my->KML_description 'kml description';
//$my->filename = "peto.kml";
$my->outputDirectory "./export/";

// c.1) add Point(s) placemark(s) to your KML file
$my->addPointPlacemark("placemark name","<b>description</b>",42.000421,21.057541,0);
$my->addPointPlacemark("placemark name3","description",42.78777,21.052521,0);
$my->addPointPlacemark("placemark name4","description",42.11251,21.744521,0);

// or c.2) to add Line placemark to KML file
// $my->addLinePlacemark();

// d.1) create KML file
//$my->CreateKMLfile();

// d.2) or download KML file
//$my->DownloadKMLfile("TXT");

// d.3) or display KML file
$my->DisplayKMLfile();

// HOWTO display phpGoogleKML properties ?
//echo $my->KML_name;
//echo $my->KML_description;
//echo $my->outputDirectory;
//echo $my->xmlns_url;
// etc ...

?>