From 981cfeac2ede69205da710ac38714938bcb85239 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Fri, 5 Aug 2011 05:01:08 +0530 Subject: [PATCH] Labels for exporting points as PNG --- libraries/gis/pma_gis_point.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/gis/pma_gis_point.php b/libraries/gis/pma_gis_point.php index 8971768cf1..12a3d27a30 100644 --- a/libraries/gis/pma_gis_point.php +++ b/libraries/gis/pma_gis_point.php @@ -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; }