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

Can Leaflet.heat emulate the default Google visualization.HeatmapLayer ? #10

Open
sheffieldnikki opened this issue May 16, 2014 · 2 comments

Comments

@sheffieldnikki
Copy link

I have a map that uses Google Maps and their visualization.HeatmapLayer with the default colours, and radius=20:

http://racelifts.org/Highland-Fling-2014/stats

I'm trying to reproduce this as closely as I can with Leaflet and Leaflet.heat - colours, opacity, etc. I've experimented with radius, blur, maxZoom & gradient settings, but I can't get close :( Is it possible? Thanks

@doomsuckle
Copy link

I can't really tell how the original is built. If there are fixed contours and color levels, I don't think heat will work for you because it dynamically forms little clusters with a weight.

@schlompf
Copy link

i guess you should get the colours pretty close by fiddling with the gradient settings.
for opacity:
leaflet.heat uses simpleheat for drawing the actual heatmap. You can modify the colorization by editing the _colorize-function: https://github.com/mourner/simpleheat/blob/gh-pages/simpleheat.js#L126 There you could change the max-opacity to 0.6 by adding pixels[i] *= .6 right after line 133 pixels[i - 1] = gradient[j + 2]; You then have to replace the simpleheat-library which is included in leaflet.heat with your modified version.

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

No branches or pull requests

4 participants