Skip to content
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

Heatlayer radius over 80 creates strange object outside default heat #108

Closed
mateuszrusyn opened this issue Mar 8, 2019 · 6 comments
Closed

Comments

@mateuszrusyn
Copy link

If I create heatlayer with radius over 80 it creates valid heatmap but outside that circle, something strange appears.

Code:

var heat = L.heatLayer([], { radius: 80, minOpacity: .6, opacity: 0.8, blur: 100, gradient: { 1.0: color, }, }); heat.addTo(mymap);

screen

It seems that bigger radius than some value is creating second object(?) outside default heat circle.

@corrigancd
Copy link

Have replicated this (top image). When I zoom out, it's fine. The parameters required to make each map are also specified:
image

@mpraus
Copy link

mpraus commented Jun 28, 2024

This doesn't only happen when the radius is over 80. I have the same issue with a higher blur value. As far as I can tell it only happens when the blur value is greater than or equal to the radius with the size of the object increases with the blur value.

Code to reproduce issue:

 heatLayer = L.heatLayer(heatdata, {radius: 75,  gradient: gradient, blur: 80, maxZoom:18});
 heatLayer.addTo(map);

image

As far as I can tell your issue isn't really a radius of 80 but rather that the blur level is too high. It does appear to become problematic with a radius over about 100, regardless of the blur value. I believe it has something to do with the fact that a large number of points end up overlapping.

@jxn-30
Copy link
Contributor

jxn-30 commented Jun 28, 2024

As a workaround: Import simpleheat 0.3.0 or later after importing Leaflet.heat.

Leaflet.heat includes a simpleheat version from 2014:

/*
(c) 2014, Vladimir Agafonkin
simpleheat, a tiny JavaScript library for drawing heatmaps with Canvas
https://github.com/mourner/simpleheat
*/

The issue has been resolved in simpleheat in 2015: mourner/simpleheat#14, Version 0.3.0 has been released afterwards.

Using TypeScript and Webpack, we achieved this workaround: LSS-Manager/LSSM-V.4@7d07baa importing Leaflet.heat first, then simpleheat and afterwards we've assigned the imported simpleheat to the global scope.

jxn-30 added a commit to jxn-30/Leaflet.heat that referenced this issue Jun 28, 2024
@Sergiobop
Copy link

Hi @jxn-30 is a release possible with this fix included? Thanks

@jxn-30
Copy link
Contributor

jxn-30 commented Jul 12, 2024

Hi @jxn-30 is a release possible with this fix included? Thanks

I am not a maintainer of this project, so I am not in the power to do so. However, there already exists an Issue that also requests a new release: #132

@Sergiobop
Copy link

Oh, ok, thank you anyway. I guess @IvanSanchez can do the new release?

Hi @jxn-30 is a release possible with this fix included? Thanks

I am not a maintainer of this project, so I am not in the power to do so. However, there already exists an Issue that also requests a new release: #132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants