[mapserver-commits] r7645 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Jun 4 15:28:06 EDT 2008


Author: tomkralidis
Date: 2008-06-04 15:28:05 -0400 (Wed, 04 Jun 2008)
New Revision: 7645

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapwmslayer.c
Log:
mapwmslayer.c: set QUERY_LAYERS correctly (#2001)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-06-03 15:36:38 UTC (rev 7644)
+++ trunk/mapserver/HISTORY.TXT	2008-06-04 19:28:05 UTC (rev 7645)
@@ -13,6 +13,8 @@
 Current Version (5.1-dev, SVN trunk):
 -------------------------------------
 
+- mapwmslayer.c: set QUERY_LAYERS correctly (#2001)
+
 - mapwcs.c: handle PARAMETER values correctly (#2509)
 
 - SOS: fix various memory leaks (#2412)

Modified: trunk/mapserver/mapwmslayer.c
===================================================================
--- trunk/mapserver/mapwmslayer.c	2008-06-03 15:36:38 UTC (rev 7644)
+++ trunk/mapserver/mapwmslayer.c	2008-06-04 19:28:05 UTC (rev 7645)
@@ -453,7 +453,7 @@
 {
 #ifdef USE_WMS_LYR
     char *pszEPSG = NULL;
-    const char *pszVersion, *pszTmp, *pszRequestParam, *pszExceptionsParam;
+    const char *pszVersion, *pszTmp, *pszRequestParam, *pszExceptionsParam, *pszQueryLayers=NULL;
     rectObj bbox;
     int nVersion=OWS_VERSION_NOTSET;
     
@@ -527,8 +527,12 @@
          strstr(psWMSParams->onlineresource, "query_layers=") == NULL &&
          msLookupHashTable(psWMSParams->params, "QUERY_LAYERS") == NULL)
     {
-        msSetError(MS_WMSCONNERR, "WMS Connection String must contain the QUERY_LAYERS parameter to support GetFeatureInfo requests (with name in uppercase).", "msBuildWMSLayerURL()");
-        return MS_FAILURE;
+        pszQueryLayers = msOWSLookupMetadata(&(lp->metadata), "MO", "name");
+
+        if (pszQueryLayers == NULL) {
+             msSetError(MS_WMSCONNERR, "wms_name not set or WMS Connection String must contain the QUERY_LAYERS parameter to support GetFeatureInfo requests (with name in uppercase).", "msBuildWMSLayerURL()");
+             return MS_FAILURE;
+        }
     }
 
 
@@ -660,7 +664,7 @@
  *   FORMAT
  *   TRANSPARENT
  *   STYLES
- *   QUERY_LAYERS (for queriable layers only)
+ *   QUERY_LAYERS (for queryable layers only)
  * ------------------------------------------------------------------ */
 
     if (nRequestType == WMS_GETFEATUREINFO)
@@ -692,8 +696,12 @@
         msSetWMSParamInt(   psWMSParams, "Y",       nClickY);
  
         msSetWMSParamString(psWMSParams, "EXCEPTIONS", pszExceptionsParam, MS_FALSE);
-        msSetWMSParamString(psWMSParams, "INFO_FORMAT",pszInfoFormat, MS_TRUE);
+        msSetWMSParamString(psWMSParams, "INFO_FORMAT", pszInfoFormat, MS_TRUE);
 
+        if (pszQueryLayers) { /* not set in CONNECTION string */
+          msSetWMSParamString(psWMSParams, "QUERY_LAYERS", pszQueryLayers, MS_FALSE);
+        }
+
         /* If FEATURE_COUNT <= 0 then don't pass this parameter */
         /* The spec states that FEATURE_COUNT must be greater than zero */
         /* and if not passed then the behavior is up to the server */



More information about the mapserver-commits mailing list