You need to sign in to do that
Don't have an account?
B
Heatmap coloring is not working
I'm trying to display a heatmap on the leaflet map but the coloring is not working. Here is the llibrary that i use and the code
I use this for heatmap https://github.com/Leaflet/Leaflet.heat
var map = L.map('map', {zoomControl: true, tap: false, preferCanvas:true})
var baseLayer = { };
var locationsAccounts = new Array(accounts.length);
var heatmapLayer = L.heatLayer([0,0],{ radius: 20,
blur: 15,
maxZoom: 10,
max: 1.0,
gradient: {
0.0: 'green',
0.5: 'yellow',
1.0: 'red'
}
});
var overlays = { "Heatmap": heatmapLayer };
L.control.layers(baseLayer, overlays).addTo(map);
for (var i=0, len = accounts.length; i<len; i++) {
locationsAccounts[i]=[accounts[i].Latitude, accounts[i].Longitude,0.5]; }
heatmapLayer.setLatLngs(locationsAccounts);
I use this for heatmap https://github.com/Leaflet/Leaflet.heat
var map = L.map('map', {zoomControl: true, tap: false, preferCanvas:true})
var baseLayer = { };
var locationsAccounts = new Array(accounts.length);
var heatmapLayer = L.heatLayer([0,0],{ radius: 20,
blur: 15,
maxZoom: 10,
max: 1.0,
gradient: {
0.0: 'green',
0.5: 'yellow',
1.0: 'red'
}
});
var overlays = { "Heatmap": heatmapLayer };
L.control.layers(baseLayer, overlays).addTo(map);
for (var i=0, len = accounts.length; i<len; i++) {
locationsAccounts[i]=[accounts[i].Latitude, accounts[i].Longitude,0.5]; }
heatmapLayer.setLatLngs(locationsAccounts);
Best Answer chosen by B
B
Issue from chrome that i could not resolve it