makinacorpus/Leaflet.AlmostOver

Name: Leaflet.AlmostOver

Owner: Makina Corpus

Description: Trigger mouse events when cursor is "almost" over a layer

Created: 2013-09-24 15:38:26.0

Updated: 2017-12-29 16:15:39.0

Pushed: 2017-11-20 17:02:11.0

Homepage: http://makinacorpus.github.io/Leaflet.AlmostOver

Size: 42

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Leaflet.AlmostOver

This plugin allows to detect mouse click and overing events on lines, with a tolerance distance.

It is useful if paths are drawn with a very small weight, or for clicks detection on mobile devices, for which finger precision can be a problem.

Play with online demo.

It requires Leaflet.GeometryUtil.

Build Status

Usage
var map = L.map('map');
...
var lines = L.geoJson(...);
...
map.almostOver.addLayer(lines);

map.on('almost:over', function (e) {
    alert('Almost clicked !');
});
Events

Events triggered when mouse is almost over a layer :

Authors

Makina Corpus


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.