I have the click event registered like this:

>>>>
                map.events.register('click', map, function (e) {
                        var params = {  REQUEST: "GetFeatureInfo",
                                                EXCEPTIONS: 
"application/vnd.ogc.se_xml",
                                                BBOX: map.getExtent().toBBOX(),
                                                X: e.xy.x,
                                                Y: e.xy.y,
                                                INFO_FORMAT: 'text/html',
                                                QUERY_LAYERS: layer_info,
                                                FEATURE_COUNT: 50,
                                                Styles: '',
                                                Layers: layer_info,
                                                srs: 'EPSG:900913',
                                                WIDTH: map.size.w,
                                                HEIGHT: map.size.h,
                                                format: 'image/png'     };
                        
OpenLayers.loadURL("http://app-serv-01-uat/geoserver/wms";, params, this,
setHTML, setHTML);
                        OpenLayers.Event.stop(e);
                });

But I only want the click event to happen if the layer is currently visible
(i.e. if it is checked in the Layer Switcher). Otherwise, if the user is not
currently viewing the layer, then the getFeatureInfo request should not be
called.
-- 
View this message in context: 
http://n2.nabble.com/How-do-you-unregister-a-getFeatureInfo-request-tp3687066p3687066.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to