Skip to content

Instantly share code, notes, and snippets.

@jepster
Created March 22, 2020 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jepster/1b837355a9b591966b60a11bf11ac706 to your computer and use it in GitHub Desktop.
Save jepster/1b837355a9b591966b60a11bf11ac706 to your computer and use it in GitHub Desktop.
function cleanHeatmap() {
map.removeLayer(heatmap);
}
function showHeatmap(heatdata, maxValue) {
if (heatmap === null) {
heatmap = L.heatLayer(heatdata,
{radius: 35, max: maxValue / ratio,
blur: 25,
gradient: {0.0: 'blue', 0.5: 'lime', 1: 'red'}
}).addTo(map);
} else {
cleanHeatmap();
}
return heatmap;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment