Hi,

That's because you're using the highlightOnly: true property. See in the example :

http://openlayers.org/dev/examples/highlight-feature.html

  You should do like in the example and register events :

                eventListeners: {
                    beforefeaturehighlighted: report,
                    featurehighlighted: report,
                    featureunhighlighted: report
                }


and do what you want in the callback method (in the example, the "report" method)

Regards,

Alexandre


On 11-01-18 10:22 AM, ulao wrote:
When I use the following code I never get an alert moving in or out of my
vectors? Did I do this wrong?



var layer = new OpenLayers.Layer.Vector( name );
        
Map.map2d.addLayer(layer);

                var eventControl = new OpenLayers.Control.SelectFeature(
                 layer,
                 {
                                 hover: true,
                                 highlightOnly: true,
                                 clickout: false,
                                 toggle: false,
                                 multiple: false,
                                 overFeature: function(feature) {
                                                alert("over");
                                 },
                                 outFeature: function(feature) {
                                                alert("out");
                                 }
                 });
           Map.map2d.addControl(eventControl);
           eventControl.activate();



--
Alexandre Dubé
Mapgears
www.mapgears.com

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to