0) {
$factor=str_replace('+','',urldecode($_GET['zoom']));
}
}
if (isset($_GET['uselatlaong'])) {
$dolatlong=true;
$longoff=0.0;
$latoff=0.0;
} else if (file_exists('regions.html')) {
if ($factor != 1.0) {
echo str_replace("function onl() {", "function onl() { \n document.body.style.zoom=((izoom == 1.0) ? ('' + eval(izoom * 100.0) + '%') : '" . (100.0 * $factor) . "%'); \n ", file_get_contents('regions.html'));
exit;
} else {
echo file_get_contents('regions.html');
exit;
}
}
// Create a transparent image thanks to https://www.php.net/manual/en/function.imagecolortransparent.php
$im = imagecreatetruecolor((360.0 * $factor), (180.0 * $factor));
$black = imagecolorallocate($im, 0, 0, 0);
// Make the background transparent
imagecolortransparent($im, $black);
// Save the image
$udirnameprebimg='/tmp/imagecolortransparent.png';
imagepng($im, $udirnameprebimg);
$duis='data:image/' . str_replace('jpg','jpeg',strtolower(explode('.',$udirnameprebimg)[-1 + sizeof(explode('.',$udirnameprebimg))])) . ';base64,' . base64_encode(file_get_contents($udirnameprebimg));
imagedestroy($im);
unlink($udirnameprebimg);
$htmlis="
Display GeoJSON Coastline
var izoom=location.search.split('zoom=')[1] ? eval(decodeURIComponent(location.search.split('zoom=')[1].split('&')[0])) : 1.0;
function onl() {
if (izoom != 1.0) document.body.style.zoom=('' + eval(izoom * 100.0) + '%');
var elem = document.getElementById('mycanvas');
elem.style.cursor='progress';
var context = elem.getContext('2d');
context.strokeStyle = '#000000';
}
GeoJSON World Coastline
RJM Programming - January, 2023
";
$geojsonis=file_get_contents('coastline.geojson');
$parts=explode("]]", $geojsonis);
for ($i=0; $i<(-1 + sizeof($parts)); $i++) {
$coords=str_replace('[','',str_replace(']','',explode('[[' , $parts[$i])[-1 + sizeof(explode('[[' , $parts[$i]))]));
$newcoords=$coords;
if (!$dolatlong || 1 == 1) {
$lls=explode(",", $coords);
$newcoords="";
for ($j=0; $j\n";
//echo "\n";
}
if (!file_exists('regions.html') && strpos(('' . $_SERVER['QUERY_STRING']), 'zoom=') === false && strpos(('' . $_SERVER['QUERY_STRING']), 'uselatlaong=') === false) {
file_put_contents('regions.html', str_replace("}", " context.stroke(); \n elem.style.cursor='pointer'; \n}", str_replace("", $abit . "", $htmlis)));
}
echo str_replace("}", " context.stroke(); \n elem.style.cursor='pointer'; \n}", str_replace("", $abit . "", $htmlis));
?>