changeset 146:05d719a763ca gmap2

Stuff.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 09 Mar 2014 16:46:39 +0200
parents 36d253c09da3
children 543378a480c0
files overlay.php
diffstat 1 files changed, 23 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/overlay.php	Sun Mar 09 16:25:23 2014 +0200
+++ b/overlay.php	Sun Mar 09 16:46:39 2014 +0200
@@ -36,7 +36,7 @@
 
 $c_trans = imagecolorallocate($im, 0,32,0);
 imagecolortransparent($im, $c_trans);
-$c_alpha = imagecolorallocatealpha($im, 0,0,0,64);
+$c_alpha = imagecolorallocatealpha($im, 0,0,0,128);
 $c_black = imagecolorallocate($im, 0,0,0);
 $c_white = imagecolorallocate($im, 255,255,255);
 
@@ -86,28 +86,45 @@
 {
   $xoffs = $data[0] * $zoom;
   $yoffs = $data[1] * $zoom;
-  $char  = $data[2];
+  $text  = $data[2];
 
   if ($zoom >= 4 && chkcoords($xoffs, $yoffs))
   {
     $px = $xoffs - $xorig;
     $py = $yoffs - $yorig;
 
-    $box = imagettfbbox($labelsize[$zoom], 0, $labelfont, $char);
-    imagefilledrectangle($im,$px+$box[6],$py+$box[7]+5,$px+$box[2],$py+$box[3]+5,$c_alpha);
-    imagettftext($im,$labelsize[$zoom],0,$px,$py+5, $c_white, $labelfont, $char);
-    //imagestring($im,1,$px,$py,$char,$c_white);
+    $box = imagettfbbox($labelsize[$zoom], 0, $labelfont, $text);
+    imagefilledrectangle($im,
+      $px+$box[6]-2,
+      $py+$box[7]+2,
+      $px+$box[2]+2,
+      $py+$box[3]+6,
+      $c_alpha);
+/*
+    for ($oy = -2; $oy <= 2; $oy += 1)
+    for ($ox = -2; $ox <= 2; $ox += 1)
+    {
+      if ($ox != 0 && $oy != 0)
+      imagettftext($im,$labelsize[$zoom],0,$px+$ox,$py+5+$oy, $c_alpha, $labelfont, $text);
+    }
+*/
+
+    imagettftext($im,$labelsize[$zoom],0,$px,$py+5, $c_white, $labelfont, $text);
     $flag = TRUE;
   }
 }
 fclose($file);
 
+
+// If tile block is dirty, store to a file
 if ($flag)
 {
   @imagepng($im, $cachefile);
   @chmod($cachefile, 0644);
 }
 
+
+// Send out as PNG
 header("Content-type: image/png");
 imagepng($im);
 imagedestroy($im);