This repository was archived by the owner on Oct 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathlayers.ejs
More file actions
104 lines (95 loc) · 2.46 KB
/
Copy pathlayers.ejs
File metadata and controls
104 lines (95 loc) · 2.46 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
<% sources[sid].vector_layers.forEach(function (layer) { %>
var layerColor = '#' + randomColor(lightColors);
map.addLayer({
'id': '<%= layer.id %>-polygons',
'type': 'fill',
'source': '<%= sid %>',
'source-layer': '<%= layer.id %>',
'filter': ["==", "$type", "Polygon"],
'layout': {},
'paint': {
'fill-opacity': 0.1,
'fill-color': layerColor
}
});
map.addLayer({
'id': '<%= layer.id %>-polygons-outline',
'type': 'line',
'source': '<%= sid %>',
'source-layer': '<%= layer.id %>',
'filter': ["==", "$type", "Polygon"],
'layout': {
'line-join': 'round',
'line-cap': 'round'
},
'paint': {
'line-color': layerColor,
'line-width': 1,
'line-opacity': 0.75
}
});
map.addLayer({
'id': '<%= layer.id %>-polygons-vertices',
'type': 'circle',
'source': '<%= sid %>',
'source-layer': '<%= layer.id %>',
'filter': ["==", "$type", "Polygon"],
'layout': {
'visibility': 'none',
},
'paint': {
'circle-color': layerColor,
'circle-radius': 2,
'circle-opacity': 0.75
}
});
map.addLayer({
'id': '<%= layer.id %>-lines',
'type': 'line',
'source': '<%= sid %>',
'source-layer': '<%= layer.id %>',
'filter': ["==", "$type", "LineString"],
'layout': {
'line-join': 'round',
'line-cap': 'round'
},
'paint': {
'line-color': layerColor,
'line-width': 1,
'line-opacity': 0.75
}
});
map.addLayer({
'id': '<%= layer.id %>-lines-vertices',
'type': 'circle',
'source': '<%= sid %>',
'source-layer': '<%= layer.id %>',
'filter': ["==", "$type", "LineString"],
'layout': {
'visibility': 'none',
},
'paint': {
'circle-color': layerColor,
'circle-radius': 2,
'circle-opacity': 0.75
}
});
map.addLayer({
'id': '<%= layer.id %>-pts',
'type': 'circle',
'source': '<%= sid %>',
'source-layer': '<%= layer.id %>',
'filter': ["==", "$type", "Point"],
'paint': {
'circle-color': layerColor,
'circle-radius': 2.5,
'circle-opacity': 0.75
}
});
layers.polygons.push('<%= layer.id %>-polygons');
layers.polygons.push('<%= layer.id %>-polygons-outline');
layers.lines.push('<%= layer.id %>-lines');
layers.pts.push('<%= layer.id %>-pts');
layers.polygonsVertices.push('<%= layer.id %>-polygons-vertices');
layers.linesVertices.push('<%= layer.id %>-lines-vertices');
<% }); %>