-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leaflet.heat intensity is between 0.0 and 1.0 #5236
Conversation
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'. |
jenkins, test it |
This needs to be rebased on master or have master merged into it. |
I rebased |
jenkins, test it |
What needs to be done for this to go in? Or is #6014 going to go in instead? |
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'. |
jenkins, test it |
The reason it looks pretty much identical at the top level is because the leaflet.heat module uses the current zoomLevel to calculate the intensity (https://github.com/spalger/Leaflet.heat/blob/gh-pages/src/HeatLayer.js#L131 and line 149). If the current zoomLevel and the "maximum zoom" attribute are the same, then it looks a lot different. Here's an example of zooming in with three different code bases: current code, using the value directly, or using this new code plus changing the maximum zoom to equal the zoomLevel. With the current code, you don't start to differentiate anything till you get much farther in. That is because as you get closer to the "maximum zoom", the zoom factor of the intensity decreases and so the value can finally be seen. I'm not sure if the zoom factor should change automatically but I'm open to adding that to this pull request. |
I see what you're saying, and your code does seem more correct. I think the original I want to dig in to #6014 some more before I merge this, but I think these changes are very simple and reasonable, and produce better results. Should get this in soon, sorry for the delay on it. |
#6014 does in fact fix the same issue, but it also adds extra functionality and needs a little more work. I see no reason not to merge this in the meantime. LGTM! |
Leaflet.heat intensity is between 0.0 and 1.0
My heatmaps were looking really strange and after debugging, I discovered that Leaflet.heat expects the intensity to be between 0.0. and 1.0. https://github.com/spalger/Leaflet.heat/blob/gh-pages/src/HeatLayer.js#L129 is where it defaults the max to 1 (Kibana isn't passing in a max value) and https://github.com/spalger/Leaflet.heat/blob/gh-pages/src/HeatLayer.js#L173 makes sure it never goes over the max value.