[mapserver-commits] r11325 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Mar 24 08:29:27 EDT 2011


Author: assefa
Date: 2011-03-24 05:29:27 -0700 (Thu, 24 Mar 2011)
New Revision: 11325

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapwms.c
Log:
Apply sld after bbox and srs have been parsed (#3765)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-03-24 08:59:58 UTC (rev 11324)
+++ trunk/mapserver/HISTORY.TXT	2011-03-24 12:29:27 UTC (rev 11325)
@@ -15,7 +15,7 @@
 Current Version (SVN trunk):
 ----------------------------
 
-- ...
+- WMS: Apply sld after bbox and srs have been parsed (#3765)
 
 Version 6.0.0-beta3 (2011-03-23)
 --------------------------------

Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c	2011-03-24 08:59:58 UTC (rev 11324)
+++ trunk/mapserver/mapwms.c	2011-03-24 12:29:27 UTC (rev 11325)
@@ -408,6 +408,7 @@
 
   char *bboxrequest=NULL;
   const char *sldenabled=NULL;
+  char *sld_url=NULL, *sld_body=NULL;
 
    epsgbuf[0]='\0';
    srsbuffer[0]='\0';
@@ -450,13 +451,11 @@
           {
             if (strcasecmp(names[i], "SLD") == 0)
             {
-              if ((status = msSLDApplySLDURL(map, values[i], -1, NULL)) != MS_SUCCESS)
-                return msWMSException(map, nVersion, NULL, wms_exception_format);
+              sld_url =  values[i];
             }
             if (strcasecmp(names[i], "SLD_BODY") == 0)
             {
-              if ((status =msSLDApplySLD(map, values[i], -1, NULL)) != MS_SUCCESS)
-                return msWMSException(map, nVersion, NULL, wms_exception_format);
+              sld_body =  values[i];
             }
           }
        }
@@ -1078,6 +1077,18 @@
         map->units = iUnits;
   }
 
+  /*apply sld if defined. This is done here so that bbox and srs are already applied*/
+  if (sld_url)
+  {
+      if ((status = msSLDApplySLDURL(map, sld_url, -1, NULL)) != MS_SUCCESS)
+        return msWMSException(map, nVersion, NULL, wms_exception_format);
+      
+  }
+  else if (sld_body)
+  {
+      if ((status =msSLDApplySLD(map, sld_body, -1, NULL)) != MS_SUCCESS)
+        return msWMSException(map, nVersion, NULL, wms_exception_format);
+  }
   /* Validate Styles :
   ** mapserv does not advertize any styles (the default styles are the
   ** one that are used. So we are expecting here to have empty values



More information about the mapserver-commits mailing list