Labels for exporting points as PNG

This commit is contained in:
Madhura Jayaratne 2011-08-05 05:01:08 +05:30
parent e2d535cc56
commit 981cfeac2e

View File

@ -59,6 +59,7 @@ class PMA_GIS_Point extends PMA_GIS_Geometry
public function prepareRowAsPng($spatial, $label, $point_color, $scale_data, $image)
{
// allocate colors
$black = imagecolorallocate($image, 0, 0, 0);
$red = hexdec(substr($point_color, 1, 2));
$green = hexdec(substr($point_color, 3, 2));
$blue = hexdec(substr($point_color, 4, 2));
@ -72,6 +73,10 @@ class PMA_GIS_Point extends PMA_GIS_Geometry
if ($points_arr[0][0] != '' && $points_arr[0][1] != '') {
imagearc($image, $points_arr[0][0], $points_arr[0][1], 7, 7, 0, 360, $color);
}
// print label if applicable
if (isset($label) && trim($label) != '') {
imagestring($image, 2, $points_arr[0][0], $points_arr[0][1], trim($label), $black);
}
return $image;
}