0.5.2 • Published 4 years ago

leaflet-sleep v0.5.2

Weekly downloads
365
License
MIT
Repository
github
Last release
4 years ago

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

0.5.2

4 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago