[OpenLayers-Users] Beforegetfeatureinfo and getfeatureinfo

Bart van den Eijnden bartvde at osgis.nl
Wed Nov 9 08:34:00 EST 2011


Hi Luca,

no this is not possible currently, please file an enhancement ticket (patches welcome ofcourse).

A workaround you can try is something like (untested pseudo code):

var findLayers = control.findLayers;
control.events.on({
    beforegetfeatureinfo: function(evt) {
        if // do your zoom level check here {
            control.findLayers = function() {
                return [];
           };
        } else {
            control.findLayers = findLayers;
        }
    }
});

Best regards,
Bart

-- 
Bart van den Eijnden
OSGIS - http://osgis.nl

On Nov 9, 2011, at 2:26 PM, Luca Casagrande wrote:

> Hello folks,
> Is it possible to disable the getfeatureinfo event of
> OpenLayers.Control.WMSGetFeatureInfo with a check made on the
> beforegetfeatureinfo event?
> I need to check the zoom level and, if not in range, don't send the request
> to the server.
> 
> Thanks for the help
> Luca
> 
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Beforegetfeatureinfo-and-getfeatureinfo-tp6977952p6977952.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111109/d65ff88a/attachment-0001.html


More information about the Users mailing list