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

Plugin for Leaflet for preventing unwanted scroll capturing


Version published
Maintainers
1
Created

Readme

Source

Leaflet.Sleep

Leaflet's stock maps are event-greedy and interfere with scrolling.

You can think of Leaflet.Sleep as an interaction manager, to help your map do what you want when you want.

demo

Use

Either npm install leaflet-sleep or copy/paste the source

all you need to do is include the plugin and you'll be good to go

<script src="Leaflet.Sleep.js"></script>

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,

    // defines whether the user is prompted on how to wake map
    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 (between 0 and 1) of inactive map
    sleepOpacity: .7
}

MIT Licensed

FAQs

Last updated on 28 Jun 2016

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