Adds clickTolerance option to canvas powered layers
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
spec
src
.gitignore
.travis.yml
LICENSE
README.md
karma.conf.js
package.json

README.md

Build Status

Leaflet.ClickTolerance

Adds a clickTolerance option to canvas powered layers. Increases the clickable area of vector layers beyond their visible extent. Useful when the stroke width of your vector layer is to narrow to create an usable clickable area.

Setup

Standalone

Include the javascript file on your page after Leaflet.

Node

Require the leaflet-clicktolerance package.

Usage

This plugin extends the Path options with a new option "clickTolerance". Set this option for layers you want to increase the clickable area of.

var layer = L.polyline([[0,0], [0,10]], {
    clickTolerance: 10,
});

On touch enabled browser an additional tolerance is automatically added.