Closed jericopulvera closed 5 years ago
I don't think it is a built in feature. A workaround could possibly be: If each of these points have an intensity of 0.0001 you could input these five colours and set max point intensity to 0.5.
NB: I have not read the actual source code. This assumes the colours in the heatmap is simply calculated from the sum of point intensities in the grids it creates. Meaning, If there are 5000 points in one square of the grid, that square should get intensity 5000 * 0.0001 = 0.5, which will be mahogany. We also have to assume the range is divided equally between the five colours. If you check the source code you can find out if the assumptions are true.
@Sti2nd thanks. I'll try this.
Doesn't work. All I get is mahogany and I have 296 heats. It should return yellow.
Well, it does depend on your zoom level or how large the clusters in the grid are in the source code.
You only have 296 points on your map? And all points have intensity 0.0001?
@Sti2nd yeah. But I am not getting yellow. I tried it in all zoom value. all mahogany
Oh well, I guess my assumptions were wrong or it might be a bug somewhere.
I see there are quite a few issues about heat colour, and a some pull requests as well... https://github.com/Leaflet/Leaflet.heat/pull/78
Since this repo is not actively maintained anymore, your best shot is perhaps to modify the source by e.g. basing it off the already existing pull requests.
I want to achieve this coloring.
1-1000 yellow 1001-2000 orange 2001-3000 red 3001-4000 maroon 4001-5000 mahogany