Created
August 26, 2014 14:47
-
-
Save DukeBaird/9f93399459a1e78f3c3e to your computer and use it in GitHub Desktop.
KML Maps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('BASIC_AUTH', TRUE); | |
define('CMD_LINE_OK', TRUE); | |
require_once('KML.class.php'); //Should be online | |
$kml = new KML('File'); | |
$document = new KML('Document'); | |
$document->name = 'name'; | |
$document->open = 1; | |
$folder = new KML('Folder'); | |
$folder->name = 'folder_name'; | |
$folder->visibility = "0"; | |
$placemark = new KML('Placemark'); | |
$placemark->name = htmlspecialchars("name"); | |
$placemark->description = htmlspecialchars($desc); | |
$placemark->Snippet = ''; | |
$center_point = new KML('Point'); | |
$center_point->coordinates = "{$longitude},{$latitude},0"; | |
$placemark->addObject($center_point); | |
$placemark->styleUrl = 'style.kml#style'; | |
$folder->addObject($placemark); | |
$document->addObject($folder); | |
$kml->addObject($document); | |
echo $kml->output_kml(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<kml xmlns="http://earth.google.com/kml/2.1"> | |
<Document> | |
<Style id="style"> | |
<LabelStyle> | |
<scale>0</scale> | |
</LabelStyle> | |
<IconStyle> | |
<scale>0.6</scale> | |
<Icon> | |
<href>url_to_image.png</href> | |
</Icon> | |
</IconStyle> | |
</Style> | |
</Document> | |
</kml> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment