-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheatMap.js
More file actions
23 lines (22 loc) · 736 Bytes
/
heatMap.js
File metadata and controls
23 lines (22 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function getHeatMap(mapData, map) {
Microsoft.Maps.loadModule('Microsoft.Maps.HeatMap', () => {
const locations = new Array();
const len = mapData.length;
for (let i = 0; i < len; ++i) {
if (mapData[i].HeatMap > 0)
locations.push(new Microsoft.Maps.Location(mapData[i].GpsLat, mapData[i].GpsLng));
}
const heatMap = new Microsoft.Maps.HeatMapLayer(locations, {
intensity: 1,
radius: 7,
unit: 'meters',
colorGradient: {
'0.25': 'Blue',
'0.5': 'Green',
'0.75': 'Yellow',
'1': 'Red'
}
});
map.layers.insert(heatMap);
});
}