[mapserver-commits] r9248 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Aug 12 11:02:24 EDT 2009


Author: assefa
Date: 2009-08-12 11:02:24 -0400 (Wed, 12 Aug 2009)
New Revision: 9248

Modified:
   trunk/mapserver/mapogcsld.c
Log:
support property name syntax for Rotation parameter #3085

Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2009-08-11 13:42:57 UTC (rev 9247)
+++ trunk/mapserver/mapogcsld.c	2009-08-12 15:02:24 UTC (rev 9248)
@@ -1408,6 +1408,8 @@
     int nLength = 0;
     char *pszSymbolName = NULL;
     int bFilled = 0, bStroked=0; 
+    
+    bPointLayer=0;
 
     if (psRoot && psStyle && map)
     {
@@ -3058,7 +3060,8 @@
     CPLXMLNode *psAnchor, *psAnchorX, *psAnchorY;
     double dfAnchorX=0, dfAnchorY=0;
     CPLXMLNode *psDisplacement, *psDisplacementX, *psDisplacementY;
-    CPLXMLNode *psRotation;
+    CPLXMLNode *psRotation=NULL, *psPropertyName=NULL;
+    char szTmp[100];
 
     if (psRoot && psClass)
     {
@@ -3137,10 +3140,22 @@
 /*      parse rotation.                                                 */
 /* -------------------------------------------------------------------- */
         psRotation = CPLGetXMLNode(psRoot, "Rotation");
-        if (psRotation && psRotation->psChild && psRotation->psChild->pszValue)
-          psClass->label.angle = atof(psRotation->psChild->pszValue);
-    }
-           
+        if (psRotation)
+        {
+            psPropertyName = CPLGetXMLNode(psRotation, "PropertyName");
+            if (psPropertyName)
+            {   
+                sprintf(szTmp, "%s", CPLGetXMLValue(psPropertyName, NULL, NULL));
+                psClass->label.bindings[MS_LABEL_BINDING_ANGLE].item = strdup(szTmp);
+                psClass->label.numbindings++;
+            }
+            else
+            {
+                if (psRotation->psChild && psRotation->psChild->pszValue)
+                  psClass->label.angle = atof(psRotation->psChild->pszValue);
+            }
+        }
+    }   
 }
 
 /************************************************************************/



More information about the mapserver-commits mailing list