changes to WMSGetFeatureInfo so requests can be sent on click,

rightclick, and dblclick, r=bartvde (closes #2528)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10117 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2010-03-19 09:35:53 +00:00
parent 37e0c0b4f5
commit 76983744da
2 changed files with 56 additions and 3 deletions

View File

@@ -23,7 +23,7 @@
* - <OpenLayers.Control>
*/
OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: hover
* {Boolean} Send GetFeatureInfo requests when mouse stops moving.
@@ -46,6 +46,13 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
* requests.
*/
maxFeatures: 10,
/** APIProperty: clickCallback
* {String} The click callback to register in the
* {<OpenLayers.Handler.Click>} object created when the hover
* option is set to false. Default is "click".
*/
clickCallback: "click",
/**
* Property: layers
@@ -192,8 +199,10 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
'delay': 250
}));
} else {
this.handler = new OpenLayers.Handler.Click(this,
{click: this.getInfoForClick}, this.handlerOptions.click || {});
var callbacks = {};
callbacks[this.clickCallback] = this.getInfoForClick;
this.handler = new OpenLayers.Handler.Click(
this, callbacks, this.handlerOptions.click || {});
}
},