[fusion-commits] r1985 - trunk/widgets/Theme/classes

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Nov 19 22:04:12 EST 2009


Author: christinebao
Date: 2009-11-19 22:04:10 -0500 (Thu, 19 Nov 2009)
New Revision: 1985

Modified:
   trunk/widgets/Theme/classes/theme.php
Log:
Fix ticket http://trac.osgeo.org/fusion/ticket/323
Theme: Individual rule for Numeric property is disordered.

Modified: trunk/widgets/Theme/classes/theme.php
===================================================================
--- trunk/widgets/Theme/classes/theme.php	2009-11-20 02:42:27 UTC (rev 1984)
+++ trunk/widgets/Theme/classes/theme.php	2009-11-20 03:04:10 UTC (rev 1985)
@@ -257,22 +257,33 @@
 
         if ($this->args['DISTRO'] == 'INDIV_DIST')
         {
+            $values = array();
+            
             $aggregateOptions->AddFeatureProperty($this->args['PROPERTYNAME']);
             $aggregateOptions->SelectDistinct(true);
-
             $dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);            
             while ($dataReader->ReadNext())
             {
                 $value = $this->GetFeaturePropertyValue($dataReader, $this->args['PROPERTYNAME']);
+                array_push($values, $value);
+            }
+            $dataReader->Close();
+            
+            if ($this->args['DATATYPE'] == MgPropertyType::String)
+                sort($values, SORT_STRING);
+            else
+                sort($values, SORT_NUMERIC);
 
+            for ($i = 0; $i < count($values); $i++)
+            {
                 $filterText = '&quot;' . $this->args['PROPERTYNAME'] . '&quot; = ';
                 if ($this->args['DATATYPE'] == MgPropertyType::String)
-                    $filterText .= "'" . $value . "'";
+                    $filterText .= "'" . $values[$i] . "'";
                 else
-                    $filterText .= $value;
-
+                    $filterText .= $values[$i];
+                    
                 $areaRuleXML = sprintf($areaRuleTemplate,
-                    $this->args['PROPERTYNAME'] . ': ' . $value,
+                    $this->args['PROPERTYNAME'] . ': ' . $values[$i],
                     $filterText,
                     $this->InterpolateColor($portion, $this->args['FILLFROM'], $this->args['FILLTO'], $this->args['FILLTRANS']),
                     $this->InterpolateColor($portion, $this->args['LINEFROM'], $this->args['LINETO'], 0));
@@ -290,7 +301,6 @@
 
                 $portion += $increment;
             }
-            $dataReader->Close();
         }
         else
         {



More information about the fusion-commits mailing list