$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); } $folder->addChild($links);
$Region->setLod(80 + $delta, 1300 + $delta * $delta); $Region->setFadeExtent(10, 100); $folder->addChild($placemark); } $letterlength = $CONF['gridpreflen'][$prefix['reference_index']]; $sql_column = "concat(\r\nsubstring(grid_reference,1,{$letterlength}),\r\nLPAD(substring(grid_reference,{$letterlength}+1,2) div 5 * 5,2,'0'),\r\nLPAD(substring(grid_reference,{$letterlength}+3,2) div 5 * 5,2,'0')\r\n)"; $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, 5, $square, $entry['hunk_square']); $UrlTag = $networklink->useUrl("http://" . $CONF['KML_HOST'] . $file); $html .= getHtmlLink($file, $entry['hunk_square'], 'in subhectad'); if (!isset($_GET['debug'])) { if (isset($_GET['newonly'])) { $db->Execute("insert ignore into kmlcache set `url` = 'mosaic.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 5,`rendered` = 0"); } else { $db->Execute("replace into kmlcache set `url` = 'mosaic.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 5,`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); } $folder->addChild($links);
$c = $entry['c'] > 20 ? 20 : ($entry['c'] > 4 ? 10 : $entry['c']); $point = new kmlPoint($wgs84_lat, $wgs84_long); $placemark = new kmlPlacemark($entry['hunk_square'], $name, $point); $placemark->useHoverStyle('p' . $c); $folder->addChild($placemark); list($south, $west) = $conv->national_to_wgs84($e, $n, $ri); list($north, $east) = $conv->national_to_wgs84($e + 100, $n + 100, $ri); $delta = $entry['gridimage_id'] % 10; $Region = $placemark->addChild('Region'); $Region->setBoundary($north, $south, $east, $west); $Region->setLod(10 + $delta, 600); $Region->setFadeExtent(50, 200); $networklink = new kmlNetworkLink(null, $name); $file = getKmlFilepath($kml->extension, 7, $square, $entry['hunk_square']); $UrlTag = $networklink->useUrl("http://" . $CONF['KML_HOST'] . $file); $html .= getHtmlLink($file, $entry['hunk_square']); if (!isset($_GET['debug'])) { if (isset($_GET['newonly'])) { $db->Execute("insert ignore into kmlcache set `url` = 'centisquare.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 7,`rendered` = 0"); } else { $db->Execute("replace into kmlcache set `url` = 'centisquare.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 7,`rendered` = 0"); } } $UrlTag->setItem('viewRefreshMode', 'onRegion'); $links->addChild($networklink); $Region2 = clone $Region; $Region2->setLod(500, -1); $Region2->setFadeExtent(100, 0); $networklink->addChild($Region2); } $folder->addChild($links);
} $Region = $placemark->addChild('Region'); $Region->setPoint($point, 0.01); $delta = $entry['gridimage_id'] % 30; $Region->setLod(1200 + $delta * $delta, -1); $Region->setFadeExtent(100, 0); $folder->addChild($placemark); } else { $x = $entry['x']; $y = $entry['y']; list($south, $west) = $conv->internal_to_wgs84($x, $y, $ri); list($north, $east) = $conv->internal_to_wgs84($x + 1, $y + 1, $ri); $networklink = new kmlNetworkLink(null, $entry['grid_reference']); $file = getKmlFilepath($kml->extension, 6, $square, $entry['grid_reference']); $UrlTag = $networklink->useUrl("http://" . $CONF['KML_HOST'] . $file); $html .= getHtmlLink($file, $entry['grid_reference']); if (!isset($_GET['debug'])) { if (isset($_GET['newonly'])) { $db->Execute("insert ignore into kmlcache set `url` = 'square.php?gr={$entry['grid_reference']}',filename='{$file}',`level` = 6,`rendered` = 0"); } else { $db->Execute("replace into kmlcache set `url` = 'square.php?gr={$entry['grid_reference']}',filename='{$file}',`level` = 6,`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); } }
$placemark = new kmlPlacemark_Circle($entry['hunk_square'], $entry['hunk_square'], $point, $radius); $placemark->setItem('description', $entry['percentage'] . '%'); $placemark->useHoverStyle('c1'); $circles->addChild($placemark); $x = intval(($entry['x'] - $origin['origin_x']) / 100) * 100 + $origin['origin_x']; $y = intval(($entry['y'] - $origin['origin_y']) / 100) * 100 + $origin['origin_y']; list($south, $west) = $conv->internal_to_wgs84($x, $y, $ri); list($north, $east) = $conv->internal_to_wgs84($x + 100, $y + 100, $ri); $Region = $placemark->addChild('Region'); $Region->setBoundary($north, $south, $east, $west); $Region->setLod(10, 600); $Region->setFadeExtent(50, 200); $networklink = new kmlNetworkLink(null, $entry['hunk_square']); $file = getKmlFilepath($kml->extension, 2, $square, $entry['hunk_square']); $UrlTag = $networklink->useUrl("http://" . $CONF['KML_HOST'] . $file); $html .= getHtmlLink($file, $entry['hunk_square'], 'in Myriad', " (" . $names[$entry['hunk_square']] . ")"); if (!isset($_GET['debug'])) { if (isset($_GET['newonly'])) { $db->Execute("insert ignore into kmlcache set `url` = 'myriad.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 2,`rendered` = 0"); } else { $db->Execute("replace into kmlcache set `url` = 'myriad.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 2,`rendered` = 0"); } } $UrlTag->setItem('viewRefreshMode', 'onRegion'); $links->addChild($networklink); $Region2 = clone $Region; $Region2->setLod(450, -1); $Region2->setFadeExtent(100, 0); $networklink->addChild($Region2); } }