cliffcloud / leaflet.sleep Goto Github PK
View Code? Open in Web Editor NEWPrevent unwanted scroll capturing; let you map sleep
Home Page: http://cliffcloud.github.io/Leaflet.Sleep/
License: MIT License
Prevent unwanted scroll capturing; let you map sleep
Home Page: http://cliffcloud.github.io/Leaflet.Sleep/
License: MIT License
Using Leaflet.Sleep with the latest leaflet.js (1.8.0). After I move the mouse over the map, all browsers throws a warning Listener not found in Events.js:180:10.
The Events.js is not physically present in my file structure, seems it is generated by leaflet itself and the console shows it's path as src/core/Events.js.
There might be some conflict between Leaflet.Sleep and the newest leaflet, because with older leaflet.js there is no warning.
Also when I remove Leaflet.Sleep from my webpage and use only leaflet.js, the warning is gone, so it is definitely caused by Leaflet.Sleep.
Hello,
in order to internationalize my app, I'd like to override the "disable map" string from here: https://github.com/CliffCloud/Leaflet.Sleep/blob/master/Leaflet.Sleep.js#L17
How should I proceed?
Thanks.
Currently the timer for hover activation starts when the mouse moves over the map.
This means that the map comes alive while the mouse is moving around.
Instead I'd like that timer to start only when the mouse has stopped moving relative to the map. If the mouse stops for sufficient time (the wakeTime) only then should the map activate.
I had to move from leaflet to mapbox because of the styling of the latter. Do you know how hard it is to use Leaflet.Sleep w/ a ReactMapboxGl?
is it possible to make the option of the sleepButton configurable? I would need to overwrite the options (like style and label).
I tried to define and use a custom button for Leaflet.Sleep package but it didn't work for me.
Nice library!
I am missing one feature though: Support for touch devices.
On mobile devices with touch screen we have a slightly different problem. Here it is not the mouse wheel scrolling which interferes with map zoom but the (one finger) touch scrolling which interferes with map panning. Could you maybe add support for that too?
I will look into your code and see if I can make a PR myself.
https://cliffcloud.github.io/Leaflet.Sleep/
L is not defined
Hello and thanks for this useful plugin.
Right now, in the master version of Leaflet, the sleepNote dissapears after a second or less, any plans to make this work properly?
Hey, cool project!
Not sure if they or you would even be up for it but it would be really cool to see this project merged or brought into https://github.com/PaulLeCam/react-leaflet. I think this has the potential to really compliment what is being built there.
Once pressing "disable" the Map cannot be reenabled. This happens on touch devices (Tested on Android 6.0.1 with Firefox for Android 58.0.1).
https://jsfiddle.net/9p4Lugsm/
Reenabling doesn't work if you click the disable button and then scroll. However it does work when you do not scroll after clicking the button.
(With touch simulation on desktop Firefox it works correctly)
I really like this plugin. It seems to be offering exactly what I was looking for.
But I don't like the way the plugin gets activated once it is loaded. Also I think it's not ideal that we use the map options to configure the plugin.
Wouldn't it be better to add this plugin on demand with it's own config options like:
L.Control.SleepMapControl({ options }).addTo(map);
Since using this plugin is only a minor side-track for my code, I have to add special handling like this:
mapOptions = {...};
if(...){
require('leaflet-sleep');
mapOptions.sleepOpacity = X;
...
}
map = L.map('map', mapOptions);
Most other Leaflet plugins seem to use their own construction as well and don't use the map for that.
When the 'Click to Wake' message disappears it leaves behind a dead area right in the centre of the map that does not transmit hover or click events through to the layers (such as markers) beneath. I think this is because the message layer has opacity set to zero rather than being completely removed.
Awesome plugin! Will this work with LeafletJS 1.x ?
I just tried the demo: http://cliffcloud.github.io/Leaflet.Sleep/#summary
And everytime I used the mousewheel to scroll, as soon as the page scrolled so the map was under the mouse, the map would start zooming instead.
Chrome Version 44.0.2403.157 m
Windows 7 64bit.
This is kind of a weird one...
So if you place your cursor where a map with Leaflet.Sleep is going to load on the page before it is loaded.
The Leaflet.Sleep blanket won't clear until you leave the map and re-enter it. A super small thing, just something I noticed. ๐
Is there an existing EventHandler for mobile devices for touchstart or touchend events?
Hi,
I'm interested in using Leaflet.Sleep for my project (http://opencontext.org). I can't find any license information however. Is this available for reuse / forking / etc.? If so, can you stick on a recognized open source license?
Thanks!
-Eric
Picking up from pull request #11
needed for sure.
Is there anything that's missing at the moment?
What are the pros of pulling default configs out of the plugin and forcing the user to set them?
I'm hesitant to commit fully to that because then every user needs to add ~10 lines that he or she might not care about.
@juliengirault thoughts?
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.