$delta = $entry['gridimage_id'] % 30; $Region->setLod(50 + $delta, 1300 + $delta * $delta); $Region->setFadeExtent(10, 100); $folder->addChild($placemark); } $letterlength = $CONF['gridpreflen'][$prefix['reference_index']]; $sql_column = "concat(substring(grid_reference,1,{$letterlength}+1),substring(grid_reference,{$letterlength}+3,1))"; $most = $db->GetAll("select \r\ngrid_reference,x,y,\r\n{$sql_column} as hunk_square,\r\nsum(imagecount) as images\r\nfrom gridsquare \r\nwhere {$sql_where}\r\ngroup by hunk_square \r\nhaving images > 0 \r\norder by hunk_square"); foreach ($most as $id => $entry) { $x = intval(($entry['x'] - $prefix['origin_x']) / 10) * 10 + $prefix['origin_x']; $y = intval(($entry['y'] - $prefix['origin_y']) / 10) * 10 + $prefix['origin_y']; list($south, $west) = $conv->internal_to_wgs84($x, $y, $ri); list($north, $east) = $conv->internal_to_wgs84($x + 10, $y + 10, $ri); $networklink = new kmlNetworkLink(null, $entry['hunk_square']); $file = getKmlFilepath($kml->extension, 4, $square, $entry['hunk_square']); $UrlTag = $networklink->useUrl("http://" . $CONF['KML_HOST'] . $file); $html .= getHtmlLink($file, $entry['hunk_square'], 'in Hectad', " (at least {$entry['images']} images)"); if (!isset($_GET['debug'])) { if (isset($_GET['newonly'])) { $db->Execute("insert ignore into kmlcache set `url` = 'hectad.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 4,`rendered` = 0"); } else { $db->Execute("replace into kmlcache set `url` = 'hectad.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 4,`rendered` = 0"); } } $UrlTag->setItem('viewRefreshMode', 'onRegion'); $links->addChild($networklink); $Region2 = $networklink->addChild('Region'); $Region2->setBoundary($north, $south, $east, $west); $Region2->setLod(450, -1); $Region2->setFadeExtent(100, 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;