eclipse1979 / leaflet-slider Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
@smellman, @Eclipse1979 - Hi, is it possible to add a license to this repo? Maybe a generally popular license like MIT, for example?
The option to set the slider length is documented incorrectly. Should the option is 'size'.
The <a>
slider control is not keyboard operable. Additionally, it is announced as a "link" using a screen reader (missing role="button"
, though <button type="button">
is recommended).
Also see WAI-ARIA Authoring Practices recommended keyboard interactions for buttons.
As usual, I gave this a shot while creating this issue and found that it solved my problem! The syncSlider
option.
syncSlider: true
I have programmed this slider to change opacity of some layers on my map. Before, the effect would only show after lifting the mouse button. That basically meant more clicks needed and sluggish-looking behaviour.
Now, with syncSlider: true
the function gets executed as I'm moving the slider instead of waiting for me to lift the mouse button.
Full code in case someone also wants to use this slider plugin to control opacity:
slider = L.control.slider(function(value) {
// I have two layers whose opacity I have to vary
leftOverlay.setOpacity(value/100);
rightOverlay.setOpacity(value/100);
}, { // slider options
//orientation:'vertical',
position: 'bottomright',
size: '250px',
min: 0, max: 100,
value: 70,
logo: 'O',
collapsed: false,
title: 'Set Opacity',
syncSlider: true
}
).addTo(map);
Trying to use it on my project, the when I hover the 'S' icon, nothing happens. If I manually add leaflet-control-slider-expanded
it works. Any idea why? Using current leaflet (0.7.3).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.