[OpenLayers-Users] Re: Limit features returned by hover event on Vector Layer?

Planet)x andrew.stewart at reddeer.ca
Thu Mar 3 13:55:57 EST 2011


Thanks again for the advice. I am following the code and Im obviously not
understanding the "click" part of things. My feature works fine when it is
hovered and I get the alert message, except I am getting nothing happening
when actually clicking on the feature, not sure what I am doing wrong. 


var report = function(e) {
        alert(e.type);
        alert(e.feature.id);
            };
            
            var highlightCtrl = new
OpenLayers.Control.SelectFeature(test_hydrants, {
                hover: true,
                highlightOnly: true,
                renderIntent: "temporary",
                eventListeners: {
                    beforefeaturehighlighted: report,
                    featurehighlighted: report,
                    featureunhighlighted: report
                }
            });
 
            var selectCtrl = new
OpenLayers.Control.SelectFeature(test_hydrants,
                {clickout: true,
                 click: true,
                eventListeners: {
                    featureselected: report
                    }
                }
            );
 
            map.addControl(highlightCtrl);
            map.addControl(selectCtrl);
 
            highlightCtrl.activate();
            selectCtrl.activate();
 

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Limit-features-returned-by-hover-event-on-Vector-Layer-tp6085625p6085977.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list