Skip to content

Commit f34b7fe

Browse files
committed
修改范例
1 parent 0723a59 commit f34b7fe

File tree

2 files changed

+153
-196
lines changed

2 files changed

+153
-196
lines changed

examples/mapboxgl/mvtVectorTile_Beijing.html

Lines changed: 94 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -74,28 +74,10 @@
7474

7575
});
7676
map.addLayer({
77-
"id": "湖泊、水库R@北京",
78-
"type": "fill",
79-
"source": "vector-tiles",
80-
"source-layer": "湖泊、水库R@北京",
81-
"paint": {
82-
"fill-color": "hsl(196, 80%, 70%)"
83-
}
84-
});
85-
map.addLayer({
86-
"id": " 双线河R@北京",
87-
"type": "fill",
88-
"source": "vector-tiles",
89-
"source-layer": "双线河R@北京",
90-
"paint": {
91-
"fill-color": "hsl(196, 80%, 70%)"
92-
}
93-
});
94-
map.addLayer({
95-
"id": "绿地R@北京",
77+
"id": "立交桥绿地R@北京",
9678
"type": "fill",
9779
"source": "vector-tiles",
98-
"source-layer": "绿地R@北京",
80+
"source-layer": "立交桥绿地R@北京",
9981
"paint": {
10082
"fill-color": "hsl(100, 58%, 76%)",
10183
"fill-opacity": {
@@ -114,10 +96,10 @@
11496
},
11597
});
11698
map.addLayer({
117-
"id": "立交桥绿地R@北京",
99+
"id": "绿地R@北京",
118100
"type": "fill",
119101
"source": "vector-tiles",
120-
"source-layer": "立交桥绿地R@北京",
102+
"source-layer": "绿地R@北京",
121103
"paint": {
122104
"fill-color": "hsl(100, 58%, 76%)",
123105
"fill-opacity": {
@@ -136,42 +118,102 @@
136118
},
137119
});
138120
map.addLayer({
139-
"id": "一级道路L@北京1",
121+
"id": " 双线河R@北京",
122+
"type": "fill",
123+
"source": "vector-tiles",
124+
"source-layer": "双线河R@北京",
125+
"paint": {
126+
"fill-color": "hsl(196, 80%, 70%)"
127+
}
128+
});
129+
map.addLayer({
130+
"id": "湖泊、水库R@北京",
131+
"type": "fill",
132+
"source": "vector-tiles",
133+
"source-layer": "湖泊、水库R@北京",
134+
"paint": {
135+
"fill-color": "hsl(196, 80%, 70%)"
136+
}
137+
});
138+
139+
map.addLayer({
140+
"id": " 四级道路L@北京",
140141
"type": "line",
141142
"source": "vector-tiles",
142-
"source-layer": "一级道路L@北京",
143+
"source-layer": "四级道路L@北京",
143144
"paint": {
144145
"line-width": {
145146
"base": 1.5,
146147
"stops": [
147148
[
148149
11,
149-
6
150+
1
150151
],
151152
[
152153
18,
153-
26
154+
10
154155
]
155156
]
156157
},
157-
"line-color": "hsl(230, 24%, 87%)",
158-
"line-opacity": {
159-
"base": 1,
158+
"line-color": "hsl(0, 0%, 100%)",
159+
}
160+
});
161+
map.addLayer({
162+
"id": " 三级道路L@北京",
163+
"type": "line",
164+
"source": "vector-tiles",
165+
"source-layer": "三级道路L@北京",
166+
"paint": {
167+
"line-width": {
168+
"base": 1.5,
160169
"stops": [
161170
[
162-
10.99,
163-
0
171+
11,
172+
1
164173
],
174+
[
175+
18,
176+
10
177+
]
178+
]
179+
},
180+
"line-color": "hsl(0, 0%, 100%)",
181+
}
182+
});
183+
map.addLayer({
184+
"id": " 二级道路L@北京",
185+
"type": "line",
186+
"source": "vector-tiles",
187+
"source-layer": "二级道路L@北京",
188+
"paint": {
189+
"line-width": 4,
190+
"line-color": "hsl(230, 24%, 87%)",
191+
}
192+
});
193+
map.addLayer({
194+
"id": " 二级道路L@北京1",
195+
"type": "line",
196+
"source": "vector-tiles",
197+
"source-layer": "二级道路L@北京",
198+
"paint": {
199+
"line-width": {
200+
"base": 1.5,
201+
"stops": [
165202
[
166203
11,
167-
1
204+
2
205+
],
206+
[
207+
18,
208+
18
168209
]
169210
]
170211
},
212+
"line-color": "hsl(0, 0%, 100%)",
171213
}
172214
});
173215
map.addLayer({
174-
"id": "一级道路L@北京",
216+
"id": "一级道路L@北京1",
175217
"type": "line",
176218
"source": "vector-tiles",
177219
"source-layer": "一级道路L@北京",
@@ -181,15 +223,15 @@
181223
"stops": [
182224
[
183225
11,
184-
4
226+
6
185227
],
186228
[
187229
18,
188-
20
230+
26
189231
]
190232
]
191233
},
192-
"line-color": "hsl(0, 0%, 100%)",
234+
"line-color": "hsl(230, 24%, 87%)",
193235
"line-opacity": {
194236
"base": 1,
195237
"stops": [
@@ -205,50 +247,39 @@
205247
},
206248
}
207249
});
208-
209250
map.addLayer({
210-
"id": "高速公路L@北京",
251+
"id": "一级道路L@北京",
211252
"type": "line",
212253
"source": "vector-tiles",
213-
"source-layer": "高速公路L@北京",
254+
"source-layer": "一级道路L@北京",
214255
"paint": {
215256
"line-width": {
216257
"base": 1.5,
217258
"stops": [
218259
[
219260
11,
220-
6
261+
4
221262
],
222263
[
223264
18,
224-
32
265+
20
225266
]
226267
]
227268
},
228-
"line-color": "hsl(26, 87%, 62%)",
229-
}
230-
});
231-
map.addLayer({
232-
"id": " 环城路L@北京",
233-
"type": "line",
234-
"source": "vector-tiles",
235-
"source-layer": "环城路L@北京",
236-
"paint": {
237-
"line-width": 4,
238-
"line-color": "hsl(26, 87%, 62%)",
269+
"line-color": "hsl(0, 0%, 100%)",
239270
"line-opacity": {
240271
"base": 1,
241272
"stops": [
242273
[
243274
10.99,
244-
1
275+
0
245276
],
246277
[
247278
11,
248-
0
279+
1
249280
]
250281
]
251-
}
282+
},
252283
}
253284
});
254285
map.addLayer({
@@ -295,83 +326,30 @@
295326
"line-color": "hsl(35, 32%, 91%)"
296327
}
297328
});
298-
299-
map.addLayer({
300-
"id": " 二级道路L@北京",
301-
"type": "line",
302-
"source": "vector-tiles",
303-
"source-layer": "二级道路L@北京",
304-
"paint": {
305-
"line-width": 4,
306-
"line-color": "hsl(230, 24%, 87%)",
307-
}
308-
});
309329
map.addLayer({
310-
"id": " 二级道路L@北京",
311-
"type": "line",
312-
"source": "vector-tiles",
313-
"source-layer": "二级道路L@北京",
314-
"paint": {
315-
"line-width": {
316-
"base": 1.5,
317-
"stops": [
318-
[
319-
11,
320-
2
321-
],
322-
[
323-
18,
324-
18
325-
]
326-
]
327-
},
328-
"line-color": "hsl(0, 0%, 100%)",
329-
}
330-
});
331-
map.addLayer({
332-
"id": " 三级道路L@北京",
333-
"type": "line",
334-
"source": "vector-tiles",
335-
"source-layer": "三级道路L@北京",
336-
"paint": {
337-
"line-width": {
338-
"base": 1.5,
339-
"stops": [
340-
[
341-
11,
342-
1
343-
],
344-
[
345-
18,
346-
10
347-
]
348-
]
349-
},
350-
"line-color": "hsl(0, 0%, 100%)",
351-
}
352-
});
353-
map.addLayer({
354-
"id": " 四级道路L@北京",
330+
"id": " 高速公路L@北京",
355331
"type": "line",
356332
"source": "vector-tiles",
357-
"source-layer": "四级道路L@北京",
333+
"source-layer": "高速公路L@北京",
358334
"paint": {
359335
"line-width": {
360336
"base": 1.5,
361337
"stops": [
362338
[
363339
11,
364-
1
340+
6
365341
],
366342
[
367343
18,
368-
10
344+
32
369345
]
370346
]
371347
},
372-
"line-color": "hsl(0, 0%, 100%)",
348+
"line-color": "hsl(26, 87%, 62%)",
373349
}
374350
});
351+
352+
375353
map.addLayer({
376354
"id": "标签专题图#10",
377355
"type": "symbol",
@@ -538,6 +516,7 @@
538516
},
539517
},
540518
});
519+
541520
map.addLayer({
542521
"id": "立交桥名称P@北京",
543522
"type": "symbol",

0 commit comments

Comments
 (0)