Repository navigation
Expand file tree
/
Copy pathdatalabel.js
More file actions
58 lines (58 loc) · 1.79 KB
/
Copy pathdatalabel.js
File metadata and controls
58 lines (58 loc) · 1.79 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
/**
* Datalabel sample
*/
this.default = function () {
var maps = new ej.maps.Maps({
load: function (args) {
var theme = location.hash.split('/')[1];
theme = theme ? theme : 'Material';
args.maps.theme = (theme.charAt(0).toUpperCase() + theme.slice(1));
},
zoomSettings: {
enable: false
},
layers: [
{
dataLabelSettings: {
visible: true,
labelPath: 'name',
smartLabelMode: 'Trim'
},
shapeData: window.USA,
shapeSettings: {
autofill: true
},
tooltipSettings: {
visible: true,
valuePath: 'name'
},
}
]
});
maps.appendTo('#datalabel');
var intersectaction = new ej.dropdowns.DropDownList({
index: 0,
placeholder: 'Select intersect action',
width: 120,
change: function () {
maps.layers[0].dataLabelSettings.intersectionAction = intersectaction.value;
maps.refresh();
}
});
intersectaction.appendTo('#intersectaction');
var smartlabelmode = new ej.dropdowns.DropDownList({
index: 0,
placeholder: 'Select smartlabel mode',
width: 120,
change: function () {
maps.layers[0].dataLabelSettings.smartLabelMode = smartlabelmode.value;
maps.refresh();
}
});
smartlabelmode.appendTo('#smartlabelmode');
document.getElementById('select').onchange = function () {
var element = (document.getElementById('select'));
maps.layers[0].dataLabelSettings.visible = element.checked;
maps.refresh();
};
};