[OpenLayers-Users] mouseover, mouseout events for getting popups

sjonnala sj3670 at att.com
Fri Aug 5 14:33:29 EDT 2011


Hi There,
  My present application supports mouseclick event to display a popup
containing some information. I'm trying to implement mouseover, mouseout
events also along with the existing event popup. Something like below.

        marker.events.register('mouseover', feature,
LayerDisplay.mouseover);
        marker.events.register('click', feature, LayerDisplay.markerClick);
        marker.events.register('mouseout', feature, LayerDisplay.mouseout);

    markerClick: function(evt)
    {
        sameMarkerClicked = (this == selectedFeature);
        selectedFeature = (!sameMarkerClicked) ? this : null;
       
        for(var i=0; i < ti_Markers.map.popups.length; i++) {
            ti_Markers.map.removePopup(ti_Markers.map.popups[i]);
        }

        var anchor=(this.marker)?this.marker.icon:null;
       
        popup = new
OpenLayers.Popup.Anchored("olPopup",this.data.latlon,null,this.data.popupContentHTML,anchor,true)
       
        if (!sameMarkerClicked) {
            ti_Markers.map.addPopup(popup);
        }
        OpenLayers.Event.stop(evt);
    }

    mouseover: function(evt) {
     //....implementation....
    }
    mouseout: function(evt) {
    //....implementation....
    }



Partially i was able to achieve this for mouseover. But after mouseover
event, the markerClick function is never getting called with 'click' event.
registering 'click' alone works great.

Can anyone please help me how to achieve this functionality. Thanks in
advance.
----
Satish Jonnala 

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/mouseover-mouseout-events-for-getting-popups-tp6657567p6657567.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list