diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2008-03-01 07:30:51 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2008-03-01 07:30:51 +0000 |
commit | 7c23dbb3aa2391514cc333518dd99075b9a99dc8 (patch) | |
tree | 3c033c6d4d030e910455b28c2ef6bf3b21849a45 /gpsd.php | |
parent | 57500ef19287a096078b88dd2aaeed0f33b0b04a (diff) | |
download | gpsd-7c23dbb3aa2391514cc333518dd99075b9a99dc8.tar.gz |
allow the SBAS diamond icons to be filled...
...if they're used in the navigation solution rather than making them
be circles.
Diffstat (limited to 'gpsd.php')
-rw-r--r-- | gpsd.php | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -1,5 +1,6 @@ <?php +# $Id$ #$CSK: gpsd.php,v 1.39 2006/11/21 22:31:10 ckuethe Exp $ # Copyright (c) 2006 Chris Kuethe <chris.kuethe@gmail.com> @@ -171,13 +172,15 @@ function splot($im, $sz, $C, $e){ imageString($im, 3, $x+4, $y+4, $sv, $C['black']); if ($u) - imageFilledArc($im, $x, $y, $r, $r, 0, 360, $color, 0); + if ($sv > 32) + imageFilledDiamond($im, $x, $y, $r, $color); + else + imageFilledArc($im, $x, $y, $r, $r, 0, 360, $color, 0); else - if ($sv > 32) { + if ($sv > 32) imageDiamond($im, $x, $y, $r, $color); - } else { + else imageArc($im, $x, $y, $r, $r, 0, 360, $color); - } } function imageDiamond($im, $x, $y, $r, $color){ @@ -193,6 +196,16 @@ function imageDiamond($im, $x, $y, $r, $color){ imagepolygon($im, $vx, 4, $color); } +function imageFilledDiamond($im, $x, $y, $r, $color){ + $t = $r/2; + while($t){ + $vx = array ( $x+$t, $y, $x, $y+$t, $x-$t, $y, $x, $y-$t ); + imagepolygon($im, $vx, 4, $color); + $t -= 0.5; + } +} + + function elevation($im, $sz, $C, $a){ $b = 90 - $a; $a = $sz * 0.95 * ($a/180); |