Index: tests/Control/WMSGetFeatureInfo.html
===================================================================
--- tests/Control/WMSGetFeatureInfo.html	(revision 10495)
+++ tests/Control/WMSGetFeatureInfo.html	(working copy)
@@ -146,6 +146,26 @@
         control.getInfoForHover({xy: xy});
     }
 
+    function test_nogetfeatureinfo_event(t) {
+        t.plan(1);
+        var map = new OpenLayers.Map('map');
+        // mock up active control
+        var control = new OpenLayers.Control.WMSGetFeatureInfo({
+            eventListeners: {
+                nogetfeatureinfo: function(evt) {
+                    t.ok((evt.type == "nogetfeatureinfo"), "nogetfeatureinfo listener gets called when there are no queryable layers");
+                }
+            }
+        });
+        map.addControl(control);
+        control.activate();
+
+        // 1 test
+        mode = "click";
+        xy = {x: 50, y: 50};
+        control.getInfoForClick({xy: xy});
+    }
+
     function test_activate(t) {
         t.plan(4);
         var map = new OpenLayers.Map("map");
Index: lib/OpenLayers/Control/WMSGetFeatureInfo.js
===================================================================
--- lib/OpenLayers/Control/WMSGetFeatureInfo.js	(revision 10495)
+++ lib/OpenLayers/Control/WMSGetFeatureInfo.js	(working copy)
@@ -149,6 +149,7 @@
      * beforegetfeatureinfo - Triggered before the request is sent.
      *      The event object has an *xy* property with the position of the 
      *      mouse click or hover event that triggers the request.
+     * nogetfeatureinfo - no queryable layers were found.
      * getfeatureinfo - Triggered when a GetFeatureInfo response is received.
      *      The event object has a *text* property with the body of the
      *      response (String), a *features* property with an array of the
@@ -159,7 +160,7 @@
      *      layers, *text* and *request* will only contain the response body
      *      and request object of the last request.
      */
-    EVENT_TYPES: ["beforegetfeatureinfo", "getfeatureinfo"],
+    EVENT_TYPES: ["beforegetfeatureinfo", "nogetfeatureinfo", "getfeatureinfo"],
 
     /**
      * Constructor: <OpenLayers.Control.WMSGetFeatureInfo>
@@ -424,6 +425,7 @@
     request: function(clickPosition, options) {
         var layers = this.findLayers();
         if(layers.length == 0) {
+            this.events.triggerEvent("nogetfeatureinfo");
             // Reset the cursor.
             OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
             return;
