[OpenLayers-Users] How mouseover, mouseout popups can be achieved along with mouseclick event.

sjonnala sj3670 at att.com
Fri Aug 5 14:27:33 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/How-mouseover-mouseout-popups-can-be-achieved-along-with-mouseclick-event-tp6657548p6657548.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list