[mapserver-commits] r7437 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Mar 7 08:57:58 EST 2008


Author: dmorissette
Date: 2008-03-07 08:57:58 -0500 (Fri, 07 Mar 2008)
New Revision: 7437

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapwms.c
Log:
Added support for EMPTY template with WMS GetFeatureInfo (#546)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-03-06 18:46:52 UTC (rev 7436)
+++ trunk/mapserver/HISTORY.TXT	2008-03-07 13:57:58 UTC (rev 7437)
@@ -13,6 +13,8 @@
 Current Version (5.1-dev, SVN trunk):
 -------------------------------------
 
+- Added support for EMPTY template with WMS GetFeatureInfo (#546)
+
 - Throw an exception if the WCS request does not overlap layer (#2503)
 
 - Acquire TLOCK_PROJ for pj_transform() calls (#2533).

Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c	2008-03-06 18:46:52 UTC (rev 7436)
+++ trunk/mapserver/mapwms.c	2008-03-07 13:57:58 UTC (rev 7437)
@@ -2315,7 +2315,7 @@
   const char *info_format="MIME";
   double cellx, celly;
   errorObj *ms_error = msGetErrorObj();
-  int status;
+  int query_status=MS_NOERR;
   const char *pszMimeType=NULL;
   int query_layer = 0;
 
@@ -2419,7 +2419,7 @@
       feature_count = 1;
 
   if(msQueryByPoint(map, -1, (feature_count==1?MS_SINGLE:MS_MULTIPLE), point, 0, feature_count) != MS_SUCCESS)
-    if(ms_error->code != MS_NOTFOUND) return msWMSException(map, nVersion, NULL);
+      if((query_status=ms_error->code) != MS_NOTFOUND) return msWMSException(map, nVersion, NULL);
 
   /* Generate response */
   if (strcasecmp(info_format, "MIME") == 0 ||
@@ -2463,7 +2463,12 @@
      msObj->MapPnt.x = point.x;
      msObj->MapPnt.y = point.y;
 
-     if ((status = msReturnTemplateQuery(msObj, (char*)pszMimeType,NULL)) != MS_SUCCESS)
+     if (query_status == MS_NOTFOUND && msObj->Map->web.empty)
+     {
+         if(msReturnURL(msObj, msObj->Map->web.empty, BROWSE) != MS_SUCCESS)
+             return msWMSException(map, nVersion, NULL);
+     }
+     else if (msReturnTemplateQuery(msObj, (char*)pszMimeType,NULL) != MS_SUCCESS)
          return msWMSException(map, nVersion, NULL);
 
      /* We don't want to free the map, and param names/values since they */



More information about the mapserver-commits mailing list