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 styles for icons in 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.) Set the variable enable_style_tag to true to enable styles support
$my->enable_style_tag true;

// d.) define you own styles
$my->AddStyle('http://www.misovic.net/images/google_maps/iconb.png','created_geocache');
$my->AddStyle('http://www.misovic.net/images/google_maps/icong.png','found_geocache');
$my->AddStyle('http://www.misovic.net/images/google_maps/iconr.png','notfound_geocache');

// e.) add styled Point(s) placemark(s) 
$my->addStylePointPlacemark('placemark name','placemark description',48.14,28.11,0,'id_name_as_defined');

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

// f.2) or display KML file as TXT
//$my->DownloadKMLfile("TXT");

// f.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 ...

?>