Repository navigation
Expand file tree
/
Copy pathmulti-layer.js
More file actions
124 lines (124 loc) · 4.28 KB
/
Copy pathmulti-layer.js
File metadata and controls
124 lines (124 loc) · 4.28 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/**
* Multilayer sample
*/
this.default = function () {
var maps = new ej.maps.Maps({
// custom code start
load: function (args) {
var layertheme = location.hash.split('/')[1];
layertheme = layertheme ? layertheme : 'Material';
args.maps.theme = (layertheme.charAt(0).toUpperCase() + layertheme.slice(1));
},
// custom code end
zoomSettings: {
enable: true,
pinchZooming: true
},
titleSettings: {
text: 'Samsung Semiconductor office locations in USA',
textStyle: {
size: '16px'
}
},
layers: [
{
shapeData: new ej.maps.MapAjax('./src/maps/map-data/usa.json'),
shapeSettings: {
fill: '#E5E5E5',
border: {
color: 'black',
width: 0.1
}
},
dataLabelSettings: {
visible: true,
labelPath: 'iso_3166_2',
smartLabelMode: 'Hide'
}
},
{
shapeData: new ej.maps.MapAjax('./src/maps/map-data/texas.json'),
type: 'SubLayer',
shapeSettings: {
fill: 'rgba(141, 206, 255, 0.6)',
border: {
color: '#1a9cff',
width: 0.25
}
},
markerSettings: [
{
visible: true,
width: 20,
height: 20,
template: '#markercircle',
dataSource: [
{
latitude: 30.267153,
longitude: -97.7430608,
name: 'Austin'
}
],
tooltipSettings: {
visible: true,
valuePath: 'name',
format: '<b>${name}</b><br>Manufacturing Center,<br>Research and Development Center'
}
},
{
visible: true,
dataSource: [
{
latitude: 31.80289258670676,
longitude: -98.96484375
}
],
template: '<div>TX</div>'
}
]
},
{
shapeData: new ej.maps.MapAjax('./src/maps/map-data/california.json'),
type: 'SubLayer',
shapeSettings: {
fill: 'rgba(141, 206, 255, 0.6)',
border: {
color: '#1a9cff',
width: 0.25
}
},
markerSettings: [
{
visible: true,
width: 20,
height: 20,
dataSource: [
{
latitude: 37.3382082,
longitude: -121.8863286,
name: 'San Jose'
}
],
tooltipSettings: {
visible: true,
valuePath: 'name',
format: '<b>${name}</b><br>Regional Office,<br>Research and Development Center'
},
template: '#markercircle'
},
{
visible: true,
dataSource: [
{
latitude: 37.09023980307208,
longitude: -119.35546875000001
}
],
template: '<div>CA</div>'
}
]
}
]
});
maps.appendTo('#container');
};