Skip to content

Conversation

jacobtoye
Copy link
Member

The need for this functionality is more apparent when using the Leaflet.iconlabel plugin. As the icons label is a sibling to the icon the label will appear under a marker that is further down the screen (will have higher z-index). This pull fixes the issue.

This will also mean that when using different icons, the one that the user is over will show.

Added a couple of options to L.Marker: bringToFront and bringToFrontZOffset. Could probably turn the functionality off by default if necessary.

If accepted I will also update the docs.

mourner added a commit that referenced this pull request Oct 30, 2012
Bring markers to front when mouseover
@mourner mourner merged commit b0a9115 into Leaflet:master Oct 30, 2012
@mourner
Copy link
Member

mourner commented Oct 30, 2012

Merged finally, thanks! Renamed the option to riseOnHover (does it make sense?) and turned it off by default (doesn't look good for default marker icons). Also refactored a bit. 8077faa

@jacobtoye
Copy link
Member Author

Awesome thanks for merging this :) Changes all make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants