[mapserver-commits] r10666 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Oct 25 09:08:49 EDT 2010


Author: assefa
Date: 2010-10-25 06:08:49 -0700 (Mon, 25 Oct 2010)
New Revision: 10666

Modified:
   trunk/mapserver/mapogcsld.c
Log:
Add rotation binding for graphics #3586

Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2010-10-25 02:16:10 UTC (rev 10665)
+++ trunk/mapserver/mapogcsld.c	2010-10-25 13:08:49 UTC (rev 10666)
@@ -1576,8 +1576,10 @@
     char *psColor=NULL, *psColorName = NULL;
     int nLength = 0;
     char *pszSymbolName = NULL;
-    int bFilled = 0, bStroked=0; 
-    
+    int bFilled = 0, bStroked=0;
+    CPLXMLNode *psPropertyName=NULL;
+    char szTmp[256];
+
     bPointLayer=0;
 
     if (!psRoot || !psStyle || !map)
@@ -1608,9 +1610,21 @@
               psStyle->opacity = (int)(atof(psOpacity->psChild->pszValue) * 100);
 
             psRotation = CPLGetXMLNode(psGraphic, "Rotation");
-            if (psRotation && psRotation->psChild && psRotation->psChild->pszValue)
-              psStyle->angle = atof(psRotation->psChild->pszValue);
-
+            if (psRotation)
+            {
+                psPropertyName = CPLGetXMLNode(psRotation, "PropertyName");
+                if (psPropertyName)
+                {   
+                    snprintf(szTmp, sizeof(szTmp), "%s", CPLGetXMLValue(psPropertyName, NULL, NULL));
+                    psStyle->bindings[MS_STYLE_BINDING_ANGLE].item = strdup(szTmp);
+                    psStyle->numbindings++;
+                }
+                else
+                {
+                    if (psRotation->psChild && psRotation->psChild->pszValue)
+                      psStyle->angle = atof(psRotation->psChild->pszValue);
+                }
+            }
             psDisplacement = CPLGetXMLNode(psGraphic, "Displacement");
             if (psDisplacement)
             {



More information about the mapserver-commits mailing list