New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

leaflet-range

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-range

A simple HTML5 range control for Leaflet maps

0.1.5
latest
Source
npm
Version published
Weekly downloads
33
57.14%
Maintainers
1
Weekly downloads
 
Created
Source

Leaflet.Range

A simple HTML5 range control for Leaflet maps.

See the example.

Tested with Leaflet 1.1.0

Install

npm install leaflet-range

Usage

Include the CSS:

<link rel="stylesheet" href="L.Control.Range.css" />

Include the JavaScript:

<script src="L.Control.Range-min.js"></script>

The control can be oriented vertically or horizontally. It will fire input and change events as the user interacts with the slider.

Example usage:


var slider = L.control.range({
    position: 'topright',
    min: 0,
    max: 100,
    value: 50,
    step: 1,
    orient: 'vertical',
    iconClass: 'leaflet-range-icon'
});

slider.on('input change', function(e) {
    console.log(e.value); // Do something with the slider value here
});

map.addControl(slider);

Credits:

Developed and maintained with support from the U.S. Forest Service and the USDA Northwest Climate Hub.

Keywords

leaflet

FAQs

Package last updated on 07 Mar 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