The code below must display some lines whither $maplat and $maplong are array whereupon their elemts has been accumulated just like that:
$maplat=array();
$maplong=array();
.....................calculus lat, long.......
array_push($maplat,$lat);
array_push($maplong,$long);
$lat and $long are real numbers.
map.php is:
header ("Content-type: image/png");
$im = @ImageCreate (824, 1200) or die ("Cannot Initialize new GD image stream");
$background_color = ImageColorAllocate ($im, 255, 255, 255);
ImageColorTransparent ($im, $background_color);
$tracecolor = ImageColorAllocate ($im, 255, 0, 0); //red line
for($t=0;$t<30;$t++)
{
if($maplat[$t] == "" && $maplong[$t] == "")
{ }
else
{
$maplat[$t] = ($maplat[$t] -1);
$maplat[$t] = ($maplat[$t] + 90);
$maplong[$t] = ($maplong[$t] + 180);
$maplong[$t] = ($maplong[$t] (1200 / 360));
$maplat[$t] = ($maplat[$t] * (824 / 180));
$maplong[$t]=round($maplong[$t]);
$maplat[$t]=round($maplat[$t]);
$maplong[$tp]=round($maplong[$tp]);
$maplat[$tp]=round($maplat[$tp]);
if($t>=1) {
$tp=$t-1;
ImageLine($im, $maplong[$tp], $maplat[$tp], $maplong[$t], $maplat[$t] , $tracecolor);
}
//ImageLine($im, 300,300,900,900 , $tracecolor);
}
ImagePNG($im);
ImageDestroy($im);
whither $maplong[$t], $maplong[$tp], $maplat[$t], $maplat[$tp] can be displayed, theirs are assertive numbers.
Therefore to be must to display lines.
But the above code not diaplay image.
[sorry for my english]