🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@wikimedia/leaflet-sleep

Package Overview
Dependencies
Maintainers
8
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wikimedia/leaflet-sleep

Leaflet plugin preventing unwanted scroll capturing

0.5.1
latest
Source
npm
Version published
Weekly downloads
4
-60%
Maintainers
8
Weekly downloads
 
Created
Source

Leaflet.Sleep

This is a fork of CliffCloud/Leaflet.Sleep. It is a lighter version of the plugin, optimized for Mediawiki use case.

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

Use

Available on npm, bower, and straight from the single. source file

Leaflet.Sleep is enabled by default, and can be disabled with the map's sleep option.

npm

npm install leaflet-sleep

bower

bower install leaflet-sleep

Config

These are the new options available for L.map and their 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

FAQs

Package last updated on 05 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts