Exemplo n.º 1
0
    if ($i) {
        require_once 'geograph/searchcriteria.class.php';
        require_once 'geograph/searchengine.class.php';
        $engine = new SearchEngine($i);
        $desc .= "<p>Displaying results for search for images<i>" . htmlentities2($engine->criteria->searchdesc) . "</i></p>";
    } else {
        $desc .= <<<END_HTML
<p>This SuperLayer allows full access to the thousends of images contributed to Geograph since March 2005, the view starts depicting a coarse overview of the current coverage, zooming in reveals more detail until pictures themselves become visible.</p>

<p>This SuperLayer will automatically update, but by design is not realtime, so can take a number of weeks for new pictures to become available in the SuperLayer.</p>
END_HTML;
    }
    $desc .= <<<END_HTML
<p><b>Join us now at: <a href="http://{$_SERVER['HTTP_HOST']}/">{$_SERVER['HTTP_HOST']}</a></b></p>
END_HTML;
    $networklink->setItemCDATA('description', $desc);
    $networklink->setItem('Snippet', 'move...scroll...rotate...tilt, to view the Geograph Archive...');
    $UrlTag = $networklink->useUrl("http://{$_SERVER['HTTP_HOST']}/kml-superlayer.php?download" . ($i ? "&i={$i}" : ''));
    $UrlTag->setItem('refreshMode', 'onInterval');
    $UrlTag->setItem('refreshInterval', 60 * 60 * 24);
    $kml->addChild($networklink);
}
if (isset($_GET['debug'])) {
    print "<a href=?download>Open in Google Earth</a><br/>";
    print "<textarea rows=35 style=width:100%>";
    print $kml->returnKML();
    print "</textarea>";
} else {
    $kml->outputKML();
}
exit;
Exemplo n.º 2
0
$kml = new kmlFile();
$document = $kml->addChild('Document');
$document->setItem('name', 'geotest');
$document->addHoverStyle();
$folder = $document->addChild('Folder');
$folder->setItem('name', 'geotest');
foreach (range(1, 2) as $i) {
    $point = new kmlPoint(rand(-9000, 9000) / 100, rand(-18000, 18000) / 100);
    $placemark = $folder->addChild(new kmlPlacemark(null, 'test' . $i, $point));
    $placemark->makeFloating();
    $placemark->useHoverStyle();
    $placemark->setTimeStamp(date('Y-m-d'));
    #$placemark->useImageAsIcon('bla.png');
    #or $placemark->makeFloating()->useHoverStyle()->useImageAsIcon('bla.png');
}
if (!isset($_GET['nolinks'])) {
    foreach (range(3, 4) as $i) {
        $networklink = $folder->addChild(new kmlNetworkLink(null, 'test' . $i, $_SERVER['SCRIPT_URI'] . "?download&nolinks"));
    }
}
if (isset($_GET['download'])) {
    $kml->outputKML(empty($_GET['simple']));
    exit;
}
print "<a href=?download>Open in Google Earth</a><br/>";
print "<textarea rows=30 style=width:100%>";
print $kml->returnKML(empty($_GET['simple']));
print "</textarea>";
exit;
print "<pre>";
print_r($kml);