Socket
Socket
Sign inDemoInstall

leaflet-sleep

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-sleep

Leaflet plugin preventing unwanted scroll capturing


Version published
Maintainers
1
Weekly downloads
432
increased by4.1%

Weekly downloads

Readme

Source

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

Use

Available on npm, bower, and from the single source source 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

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

FAQs

Last updated on 17 Apr 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc