[OpenLayers-Users] Order/Priority of Control.GetFeature and Control.WMSGetFeatureInfo on click?

Alexandre Dubé adube at mapgears.com
Thu Aug 23 05:43:09 PDT 2012


Hello,

   I'd try your solution proposed below, and manually call the 
WMSGetFeatureInfo getInfoForClick or request method.  They need an 
OpenLayers.Pixel object, so that'd be what you need to track down from 
the GetFeature control.  You might need to override one of its method 
for that, as such (untested) :

     OpenLayers.Control.GetFeature.prototype.selectClick = function(evt) {
         // override
         this.lastXY = evt.xy;

         var bounds = this.pixelToBounds(evt.xy);

         this.setModifiers(evt);
         this.request(bounds, {single: this.single});
     };

   and then, in your 'clickout' callback method, you could access what 
the last pixel was.  How does that sound ?

HTH,

Alexandre


On 12-08-23 05:35 AM, nica wrote:
> * Deactivating WMSGetFeatureInfo when GetFeature was active, and activating
> WMSGetFeatureInfo when GetFeature registered a clickout. But then the click
> event that triggered GetFeature in the first place doesn't get handed to
> WMSGetFeatureInfo.


-- 
Alexandre Dubé
Mapgears
www.mapgears.com



More information about the Users mailing list