WMSGetFeatureInfo: add an event when no queryable layers are found, r=crschmidt (closes #2744)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10670 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2010-08-22 18:44:44 +00:00
parent ed2e943e52
commit 6b9ee6bb5e
2 changed files with 23 additions and 1 deletions

View File

@@ -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");