[OpenLayers-Users] OpenLayers.Feature.Vector hover + click event

_greg_ gstopar at gmail.com
Thu Dec 10 06:34:23 EST 2009


Hi all

Is possible to recive click events and have hover turned on with
OpenLayers.Control.SelectFeature ?
I have two vector layers. One for draggable features and another for not
draggable.
I want to be able to select features from both layers (I'm using OL-2.8).
Feature hover works fine and  also featureselected events are ok. But I do
not get click events. 

My code is :
...
var vector1 = new OpenLayers.Layer.Vector("NotDraggableMarkers",{
            isBaseLayer : false,
            rendererOptions : {
                yOrdering : true
            },
            styleMap : this.getMarkerStyleMap()
            

        });
        var vector2 = new OpenLayers.Layer.Vector("DraggableMarkers",{
            isBaseLayer : false,
            rendererOptions : {
                yOrdering : true
            },
            styleMap : this.getMarkerStyleMap()
            
        });
        
        this.map.addLayers([vector1,vector2]);
        
        
        var dragFeature = new OpenLayers.Control.DragFeature(vector2);
        this.map.addControl(dragFeature);
        dragFeature.activate();


        var select = new
OpenLayers.Control.SelectFeature([vector1,vector2],{
            hover : true,
            highlightOnly : false
            
        });
        
        this.map.addControl(select);
        select.events.on({            
            "featurehighlighted" : this.high,
            "click" : this.click
        });
...

Is there any way to do this ? Any ideas ? 
Thanks.
-- 
View this message in context: http://n2.nabble.com/OpenLayers-Feature-Vector-hover-click-event-tp4144872p4144872.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list