lundi 6 janvier 2020

How to make a Heat map with some slight alterations

I'm helping a fellow web developer with a project where he basically needs to implement something similar to a heat map, but with some slight alterations. Since I already saw some applications that has a very similar implementation, I thought that might be a library to do just what we need, which is:

1) Overlapping colors with an "average"
On regular heat maps, when two "heat points" areas overlap, a "sum" is made (e.g. if two green colors overlaps, it turns into a yellow). In our case, we need an "average" (two green colors overlapping should result in a green color as well, a red and a green should make a yellow...).

2) Drawing boundaries
Using heat maps from Google maps, each heat point is a circle no mater what. In our case, there is a polygon that delimits our users's specific area and it's necessary that the colors do not be drawn outside this polygon, i.e, if a heat point is close to the polygons border, we should only drawn the part of the circle that is inside the polygon.

3) Filling the whole polygon with colors
Different from a regular heat map that would only drawn points on a map (circles inside our polygon), we would need that the whole polygon was colored (i.e. with a different color on areas where there is no heat points).

Taking all of that into consideration, we found few solutions close to what we need, this one using leaflet-geotiff being the closest to what we need.

Since it's been hard to understand how to use it (and further more, how to create the files it requires to make it work), I would like to know if someone has any idea on how to tackle this.




Aucun commentaire:

Enregistrer un commentaire