Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/CliffCloud/Leaflet.Sleep
Prevent unwanted scroll capturing; let you map sleep
https://github.com/CliffCloud/Leaflet.Sleep
Last synced: 5 days ago
JSON representation
Prevent unwanted scroll capturing; let you map sleep
- Host: GitHub
- URL: https://github.com/CliffCloud/Leaflet.Sleep
- Owner: CliffCloud
- License: mit
- Created: 2014-09-22T05:14:58.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-04-17T00:10:33.000Z (over 4 years ago)
- Last Synced: 2024-10-12T05:21:50.302Z (28 days ago)
- Language: HTML
- Homepage: http://cliffcloud.github.io/Leaflet.Sleep/
- Size: 87.9 KB
- Stars: 92
- Watchers: 6
- Forks: 26
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - CliffCloud/Leaflet.Sleep - Prevent unwanted scroll capturing; let you map sleep (others)
README
# Leaflet.Sleep
Leaflet's stock maps are event-greedy and interfere with scrolling.
`Leaflet.Sleep` is an interaction manager, helping your
map do what you want when you want.### [Demo](http://cliffcloud.github.io/Leaflet.Sleep)
## Use
Available on [npm](#npm), [bower](#bower), and from the single source
[source](https://github.com/CliffCloud/Leaflet.Sleep/blob/master/Leaflet.Sleep.js)
file.`Leaflet.Sleep` is enabled on all maps by default,
but can be disabled with each map's `sleep` option.### npm
[`npm install leaflet-sleep`](https://www.npmjs.com/package/leaflet-sleep)
### bower
`bower install leaflet-sleep`
## Config
These are the new options available for `L.map` (and the defaults).
```
{
// false if you want an unruly map
sleep: true,// time(ms) until map sleeps on mouseout
sleepTime: 750,// time(ms) until map wakes on mouseover
wakeTime: 750,// should the user receive wake instructions?
sleepNote: true,// should hovering wake the map? (non-touch devices only)
hoverToWake: true,// a message to inform users about waking the map
wakeMessage: 'Click or Hover to Wake',// a constructor for a control button
sleepButton: L.Control.sleepMapControl,// opacity for the sleeping map
sleepOpacity: .7
}
```## MIT Licensed