Allows Leaflet layers to fire 'singleclick' events
HTML JavaScript
Pull request Compare This branch is 18 commits ahead, 4 commits behind Outdooractive:gh-pages.
Latest commit dc57f2f Oct 19, 2015 @dagjomar dagjomar Merge pull request #3 from MazeMap/dj-ignore-events
Workaround for click-click-dblclick event order 'bug'
& Dj ignore events
Failed to load latest commit information.
.gitignore Adapt to 1.0.0-beta1, add bower.json Sep 29, 2015
bower.json Update version Oct 19, 2015
index.html Improve demo, do not fire event if original event has been stopped. Sep 29, 2015
singleclick.js Beautify code: unique-r method names, joint event declaration, line w… Oct 19, 2015


This plugin extends L.Evented to fire the singleclick event. A singleclick happens when clicking on something but not double-clicking for 500msec.

The timeout can be configured by setting the singleClickTimeout option on the relevant L.Evented, like so:

marker.options.singleClickTimeout = 250;
marker.on('singleclick', function(ev){ ... } );

Works with Leaflet 1.0.0-beta1 and greater. Does not work with 0.7.x.

Live example