Repository navigation
Expand file tree
/
Copy pathheat-map.js
More file actions
75 lines (74 loc) · 2.52 KB
/
Copy pathheat-map.js
File metadata and controls
75 lines (74 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* Heatmap sample
*/
this.default = function () {
var maps = new ej.maps.Maps({
// custom code start
load: function (args) {
var heatmaptheme = location.hash.split('/')[1];
heatmaptheme = heatmaptheme ? heatmaptheme : 'Material';
args.maps.theme = (heatmaptheme.charAt(0).toUpperCase() + heatmaptheme.slice(1));
},
// custom code end
format: 'n',
useGroupingSeparator: true,
titleSettings: {
text: "State wise India's population - 2011",
textStyle: {
size: '16px'
}
},
legendSettings: {
visible: true,
mode: 'Interactive',
position: 'Bottom',
height: '10',
width: '350',
alignment: 'Center',
labelDisplayMode: 'Trim'
},
zoomSettings: {
enable: false
},
layers: [
{
shapeData: new ej.maps.MapAjax('./src/maps/map-data/india.json'),
shapePropertyPath: 'NAME_1',
shapeDataPath: 'Name',
dataSource: new ej.maps.MapAjax('./src/maps/map-data/heatmap-datasource.json'),
tooltipSettings: {
visible: true,
valuePath: 'population',
format: 'State: ${Name} <br> Population: ${population}'
},
shapeSettings: {
border: {
width: 0.2,
color: 'white'
},
colorValuePath: 'population',
colorMapping: [{
from: 60000, to: 400000, color: '#9fdfdf', label: '<0.4M'
},
{
from: 400000, to: 10000000, color: '#79d2d2', label: '0.4-10M'
},
{
from: 10000000, to: 20000000, color: '#53C6C6', label: '10-20M'
},
{
from: 20000000, to: 70000000, color: '#39acac', label: '20-70M'
},
{
from: 70000000, to: 100000000, color: '#339999', label: '70-100M'
},
{
from: 100000000, to: 200000000, color: '#2d8686', label: '>100M'
}
]
}
}
]
});
maps.appendTo('#container');
};