Mouseover on multiple layers #28

Open
rpsirois opened this Issue Nov 20, 2012 · 0 comments

Comments

Projects
None yet
1 participant
@rpsirois

The mouseOut event is fired immediately after the mouseOver event for layers that are underneath other layers; therefore, only the top layer has accurate mouseOver / mouseOut events.

Here's our moderately painful solution:

var me = this;
this.detectMouseOutSet = {};

this.featureMouseOver = function( ... ) {
    me.detectMouseOutSet[ this.table_name ] = false;
    // do stuff
    document.body.style.cursor = 'pointer';
}

this.featureMouseOut = function( ... ) {
    me.detectMouseOutSet[ this.table_name ] = true;
    for ( var p in me.detectMouseOutSet ) {
        if ( !me.detectMouseOutSet[ p ] ) return;
    }
    // do stuff
    document.body.style.cursor = 'default';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment