mvtVectorTile_Beijing.html 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073
  1. <!--********************************************************************
  2. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3. *********************************************************************-->
  4. <html>
  5. <head>
  6. <meta charset='utf-8'/>
  7. <title data-i18n="resources.title_beijingMVTVectorTile"></title>
  8. <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
  9. <script type="text/javascript" src="../js/include-web.js"></script>
  10. <script type="text/javascript" exclude='iclient-mapboxgl' src="../../dist/mapboxgl/include-mapboxgl.js"></script>
  11. <style>
  12. body {
  13. margin: 0;
  14. padding: 0;
  15. }
  16. #map {
  17. position: absolute;
  18. top: 0;
  19. bottom: 0;
  20. width: 100%;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <div id='map'></div>
  26. <script type="text/javascript">
  27. var host = window.isLocal ? window.server : "https://iserver.supermap.io";
  28. var attribution = "<a href='https://www.mapbox.com/about/maps/' target='_blank'>© Mapbox </a>" +
  29. " with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a> | </span>" +
  30. " Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> ";
  31. var map = new mapboxgl.Map({
  32. container: 'map', // container id
  33. style: {
  34. "version": 8,
  35. "sources": {
  36. "vector-tiles": {
  37. "attribution": attribution,
  38. "type": "vector",
  39. "tiles": [host + "/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature.mvt?returnAttributes=true&compressTolerance=-1&width=512&height=512&viewBounds={bbox-epsg-3857}&expands=0:0_2,132_128,138_64,141_32,143_16,145_8,147_4"
  40. ]
  41. },
  42. },
  43. "sprite": "https://iclient.supermap.io/web/styles/street/sprite",
  44. "glyphs": host + "/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf",
  45. "layers": []
  46. },
  47. center: [116.4, 39.9],
  48. minZoom: 10,
  49. zoom: 11
  50. });
  51. map.addControl(new mapboxgl.NavigationControl(), 'top-left');
  52. map.on('load', function() {
  53. map.addLayer({
  54. "id": "background",
  55. "type": "background",
  56. "layout": {},
  57. "paint": {
  58. "background-color": "#75CFF0"
  59. }
  60. });
  61. map.addLayer({
  62. "id": "面区界R@北京",
  63. "type": "fill",
  64. "source": "vector-tiles",
  65. "source-layer": "面区界R@北京",
  66. "paint": {
  67. "fill-color": "#EFE9E1",
  68. }
  69. });
  70. map.addLayer({
  71. "id": "界线@北京",
  72. "type": "line",
  73. "source": "vector-tiles",
  74. "source-layer": "界线@北京",
  75. "paint": {
  76. "line-color": "hsl(240, 8%, 51%)",
  77. "line-width": 0.5
  78. }
  79. });
  80. map.addLayer({
  81. "id": "立交桥绿地R@北京",
  82. "type": "fill",
  83. "source": "vector-tiles",
  84. "source-layer": "立交桥绿地R@北京",
  85. "paint": {
  86. "fill-color": "hsl(100, 58%, 76%)",
  87. "fill-opacity": {
  88. "base": 1,
  89. "stops": [
  90. [
  91. 5,
  92. 0
  93. ],
  94. [
  95. 6,
  96. 0.5
  97. ]
  98. ]
  99. }
  100. },
  101. });
  102. map.addLayer({
  103. "id": "绿地R@北京",
  104. "type": "fill",
  105. "source": "vector-tiles",
  106. "source-layer": "绿地R@北京",
  107. "paint": {
  108. "fill-color": "hsl(100, 58%, 76%)",
  109. "fill-opacity": {
  110. "base": 1,
  111. "stops": [
  112. [
  113. 5,
  114. 0
  115. ],
  116. [
  117. 6,
  118. 0.5
  119. ]
  120. ]
  121. }
  122. },
  123. });
  124. map.addLayer({
  125. "id": " 双线河R@北京",
  126. "type": "fill",
  127. "source": "vector-tiles",
  128. "source-layer": "双线河R@北京",
  129. "paint": {
  130. "fill-color": "hsl(196, 80%, 70%)"
  131. }
  132. });
  133. map.addLayer({
  134. "id": "湖泊、水库R@北京",
  135. "type": "fill",
  136. "source": "vector-tiles",
  137. "source-layer": "湖泊、水库R@北京",
  138. "paint": {
  139. "fill-color": "hsl(196, 80%, 70%)"
  140. }
  141. });
  142. map.addLayer({
  143. "id": " 四级道路L@北京",
  144. "type": "line",
  145. "source": "vector-tiles",
  146. "source-layer": "四级道路L@北京",
  147. "paint": {
  148. "line-width": {
  149. "base": 1.5,
  150. "stops": [
  151. [
  152. 11,
  153. 1
  154. ],
  155. [
  156. 18,
  157. 10
  158. ]
  159. ]
  160. },
  161. "line-color": "hsl(0, 0%, 100%)",
  162. }
  163. });
  164. map.addLayer({
  165. "id": " 三级道路L@北京",
  166. "type": "line",
  167. "source": "vector-tiles",
  168. "source-layer": "三级道路L@北京",
  169. "paint": {
  170. "line-width": {
  171. "base": 1.5,
  172. "stops": [
  173. [
  174. 11,
  175. 1
  176. ],
  177. [
  178. 18,
  179. 10
  180. ]
  181. ]
  182. },
  183. "line-color": "hsl(0, 0%, 100%)",
  184. }
  185. });
  186. map.addLayer({
  187. "id": " 二级道路L@北京",
  188. "type": "line",
  189. "source": "vector-tiles",
  190. "source-layer": "二级道路L@北京",
  191. "paint": {
  192. "line-width": 4,
  193. "line-color": "hsl(230, 24%, 87%)",
  194. }
  195. });
  196. map.addLayer({
  197. "id": " 二级道路L@北京1",
  198. "type": "line",
  199. "source": "vector-tiles",
  200. "source-layer": "二级道路L@北京",
  201. "paint": {
  202. "line-width": {
  203. "base": 1.5,
  204. "stops": [
  205. [
  206. 11,
  207. 2
  208. ],
  209. [
  210. 18,
  211. 18
  212. ]
  213. ]
  214. },
  215. "line-color": "hsl(0, 0%, 100%)",
  216. }
  217. });
  218. map.addLayer({
  219. "id": "一级道路L@北京1",
  220. "type": "line",
  221. "source": "vector-tiles",
  222. "source-layer": "一级道路L@北京",
  223. "paint": {
  224. "line-width": {
  225. "base": 1.5,
  226. "stops": [
  227. [
  228. 11,
  229. 6
  230. ],
  231. [
  232. 18,
  233. 26
  234. ]
  235. ]
  236. },
  237. "line-color": "hsl(230, 24%, 87%)",
  238. "line-opacity": {
  239. "base": 1,
  240. "stops": [
  241. [
  242. 10.99,
  243. 0
  244. ],
  245. [
  246. 11,
  247. 1
  248. ]
  249. ]
  250. },
  251. }
  252. });
  253. map.addLayer({
  254. "id": "一级道路L@北京",
  255. "type": "line",
  256. "source": "vector-tiles",
  257. "source-layer": "一级道路L@北京",
  258. "paint": {
  259. "line-width": {
  260. "base": 1.5,
  261. "stops": [
  262. [
  263. 11,
  264. 4
  265. ],
  266. [
  267. 18,
  268. 20
  269. ]
  270. ]
  271. },
  272. "line-color": "hsl(0, 0%, 100%)",
  273. "line-opacity": {
  274. "base": 1,
  275. "stops": [
  276. [
  277. 10.99,
  278. 0
  279. ],
  280. [
  281. 11,
  282. 1
  283. ]
  284. ]
  285. },
  286. }
  287. });
  288. map.addLayer({
  289. "id": " 省道L@北京",
  290. "type": "line",
  291. "source": "vector-tiles",
  292. "source-layer": "省道L@北京",
  293. "paint": {
  294. "line-width": {
  295. "base": 1.5,
  296. "stops": [
  297. [
  298. 10,
  299. 6
  300. ],
  301. [
  302. 18,
  303. 36
  304. ]
  305. ]
  306. },
  307. "line-color": "hsl(26, 87%, 62%)",
  308. }
  309. });
  310. map.addLayer({
  311. "id": " 省道L@北京1",
  312. "type": "line",
  313. "source": "vector-tiles",
  314. "source-layer": "省道L@北京",
  315. "paint": {
  316. "line-width": {
  317. "base": 1.5,
  318. "stops": [
  319. [
  320. 10,
  321. 4
  322. ],
  323. [
  324. 18,
  325. 32
  326. ]
  327. ]
  328. },
  329. "line-color": "hsl(35, 32%, 91%)"
  330. }
  331. });
  332. map.addLayer({
  333. "id": " 高速公路L@北京",
  334. "type": "line",
  335. "source": "vector-tiles",
  336. "source-layer": "高速公路L@北京",
  337. "paint": {
  338. "line-width": {
  339. "base": 1.5,
  340. "stops": [
  341. [
  342. 11,
  343. 6
  344. ],
  345. [
  346. 18,
  347. 32
  348. ]
  349. ]
  350. },
  351. "line-color": "hsl(26, 87%, 62%)",
  352. }
  353. });
  354. map.addLayer({
  355. "id": "区政府驻地@北京",
  356. "type": "symbol",
  357. "source": "vector-tiles",
  358. "source-layer": "区政府驻地@北京",
  359. "layout": {
  360. "text-offset": [-1.5, -0.5],
  361. "text-anchor": "bottom-left",
  362. "text-field": "{NAME}",
  363. "text-max-width": 7,
  364. "text-font": [
  365. "DIN Offc Pro Medium",
  366. "Arial Unicode MS Regular"
  367. ],
  368. "text-size": 22
  369. },
  370. "paint": {
  371. "text-color": "hsl(230, 8%, 62%)",
  372. "text-opacity": {
  373. "base": 1,
  374. "stops": [
  375. [
  376. 11.99,
  377. 1
  378. ],
  379. [
  380. 12,
  381. 0
  382. ]
  383. ]
  384. },
  385. "text-halo-color": "hsl(0, 0%, 100%)",
  386. "text-halo-width": 1,
  387. "text-halo-blur": 1
  388. }
  389. });
  390. map.addLayer({
  391. "id": "标志建筑@北京",
  392. "type": "symbol",
  393. "source": "vector-tiles",
  394. "source-layer": "标志建筑@北京",
  395. "layout": {
  396. "text-offset": [-1.5, -0.5],
  397. "text-anchor": "bottom-left",
  398. "text-field": "{NAME}",
  399. "text-max-width": 7,
  400. "text-size": 14
  401. },
  402. "paint": {
  403. "text-color": "hsl(26, 25%, 32%)",
  404. "text-opacity": {
  405. "base": 1,
  406. "stops": [
  407. [
  408. 10.99,
  409. 0
  410. ],
  411. [
  412. 11,
  413. 1
  414. ]
  415. ]
  416. },
  417. "text-halo-color": "hsl(0, 0%, 100%)",
  418. "text-halo-width": 1,
  419. "text-halo-blur": 1
  420. }
  421. });
  422. map.addLayer({
  423. "id": " 一级道路Name",
  424. "type": "symbol",
  425. "source": "vector-tiles",
  426. "source-layer": "一级道路L@北京",
  427. "layout": {
  428. "text-line-height": 1.1,
  429. "text-size": {
  430. "base": 1.5,
  431. "stops": [
  432. [
  433. 13.99,
  434. 12
  435. ],
  436. [
  437. 20,
  438. 24
  439. ]
  440. ]
  441. },
  442. "text-font": [
  443. "DIN Offc Pro Italic",
  444. "Arial Unicode MS Regular"
  445. ],
  446. "symbol-placement": "line",
  447. "text-field": "{道路名称}",
  448. "text-letter-spacing": 0.1,
  449. "text-max-width": 5
  450. },
  451. "paint": {
  452. "text-color": "hsl(0, 0%, 0%)",
  453. "text-halo-color": "hsl(0, 0%, 100%)",
  454. "text-halo-width": 1.25,
  455. "text-opacity": {
  456. "base": 1,
  457. "stops": [
  458. [
  459. 13.99,
  460. 0
  461. ],
  462. [
  463. 14,
  464. 1
  465. ]
  466. ]
  467. },
  468. },
  469. });
  470. map.addLayer({
  471. "id": " 省道Name",
  472. "type": "symbol",
  473. "source": "vector-tiles",
  474. "source-layer": "省道L@北京",
  475. "layout": {
  476. "text-line-height": 1.1,
  477. "text-size": {
  478. "base": 1.5,
  479. "stops": [
  480. [
  481. 11,
  482. 10
  483. ],
  484. [
  485. 18,
  486. 24
  487. ]
  488. ]
  489. },
  490. "text-font": [
  491. "DIN Offc Pro Italic",
  492. "Arial Unicode MS Regular"
  493. ],
  494. "symbol-placement": "line",
  495. "text-field": "{道路名称}",
  496. "text-letter-spacing": 0.1,
  497. "text-max-width": 5
  498. },
  499. "paint": {
  500. "text-color": "hsl(0, 0%, 0%)",
  501. "text-halo-color": "hsl(0, 0%, 100%)",
  502. "text-halo-width": 1.25,
  503. "text-opacity": {
  504. "base": 1,
  505. "stops": [
  506. [
  507. 10.99,
  508. 0
  509. ],
  510. [
  511. 11,
  512. 1
  513. ]
  514. ]
  515. },
  516. },
  517. });
  518. map.addLayer({
  519. "id": "立交桥名称P@北京",
  520. "type": "symbol",
  521. "source": "vector-tiles",
  522. "source-layer": "立交桥名称P@北京",
  523. "layout": {
  524. "text-offset": [-1, -1],
  525. "text-anchor": "bottom",
  526. "text-field": "{NAME}",
  527. "text-size": 14
  528. },
  529. "paint": {
  530. "text-color": "hsl(0, 0%, 0%)",
  531. "text-opacity": 1,
  532. "text-halo-color": "hsl(0, 0%, 100%)",
  533. "text-halo-width": 1,
  534. "text-halo-blur": 1
  535. }
  536. });
  537. map.addLayer({
  538. "id": "长途汽车站@北京",
  539. "type": "symbol",
  540. "source": "vector-tiles",
  541. "source-layer": "长途汽车站@北京",
  542. "layout": {
  543. "icon-image": "bus-11",
  544. "text-offset": [-1, -1],
  545. "text-anchor": "bottom",
  546. "text-field": "{NAME}",
  547. "text-size": 12
  548. },
  549. "paint": {
  550. "text-color": "hsl(0, 0%, 0%)",
  551. "text-opacity": 1,
  552. "text-halo-color": "hsl(0, 0%, 100%)",
  553. "text-halo-width": 1,
  554. "text-halo-blur": 1
  555. }
  556. });
  557. map.addLayer({
  558. "id": "图书馆@北京",
  559. "type": "symbol",
  560. "source": "vector-tiles",
  561. "source-layer": "图书馆@北京",
  562. "layout": {
  563. "icon-image": "library-11",
  564. "text-offset": [-1, -1],
  565. "text-anchor": "bottom",
  566. "text-field": "{NAME}",
  567. "text-size": 12
  568. },
  569. "paint": {
  570. "text-color": "hsl(0, 0%, 0%)",
  571. "text-opacity": 1,
  572. "text-halo-color": "hsl(0, 0%, 100%)",
  573. "text-halo-width": 1,
  574. "text-halo-blur": 1
  575. }
  576. });
  577. map.addLayer({
  578. "id": "公园@北京",
  579. "type": "symbol",
  580. "source": "vector-tiles",
  581. "source-layer": "公园@北京",
  582. "layout": {
  583. "icon-image": "park-11",
  584. "text-offset": [0, -0.5],
  585. "text-anchor": "bottom",
  586. "text-field": "{NAME}",
  587. "text-size": 12
  588. },
  589. "paint": {
  590. "text-color": "hsl(0, 0%, 0%)",
  591. "text-opacity": 1,
  592. "text-halo-color": "hsl(0, 0%, 100%)",
  593. "text-halo-width": 1,
  594. "text-halo-blur": 1
  595. }
  596. });
  597. map.addLayer({
  598. "id": "综合性广场@北京",
  599. "type": "symbol",
  600. "source": "vector-tiles",
  601. "source-layer": "综合性广场@北京",
  602. "layout": {
  603. "icon-image": "campsite-11",
  604. "text-offset": [0, -0.5],
  605. "text-anchor": "bottom",
  606. "text-field": "{NAME}",
  607. "text-size": 12
  608. },
  609. "paint": {
  610. "text-color": "hsl(0, 0%, 0%)",
  611. "text-opacity": 1,
  612. "text-halo-color": "hsl(0, 0%, 100%)",
  613. "text-halo-width": 1,
  614. "text-halo-blur": 1
  615. }
  616. });
  617. map.addLayer({
  618. "id": "旅游景点@北京",
  619. "type": "symbol",
  620. "source": "vector-tiles",
  621. "source-layer": "旅游景点@北京",
  622. "layout": {
  623. "icon-image": "volcano-11",
  624. "text-offset": [0, -0.5],
  625. "text-anchor": "bottom",
  626. "text-field": "{NAME}",
  627. "text-size": 12
  628. },
  629. "paint": {
  630. "text-color": "hsl(0, 0%, 0%)",
  631. "text-opacity": 1,
  632. "text-halo-color": "hsl(0, 0%, 100%)",
  633. "text-halo-width": 1,
  634. "text-halo-blur": 1
  635. }
  636. });
  637. map.addLayer({
  638. "id": "医疗卫生@北京",
  639. "type": "symbol",
  640. "source": "vector-tiles",
  641. "source-layer": "医疗卫生@北京",
  642. "layout": {
  643. "icon-image": "hospital-11",
  644. "text-offset": [0, -0.5],
  645. "text-anchor": "bottom",
  646. "text-field": "{NAME}",
  647. "text-size": 12
  648. },
  649. "paint": {
  650. "text-color": "hsl(0, 0%, 0%)",
  651. "text-opacity": 1,
  652. "text-halo-color": "hsl(0, 0%, 100%)",
  653. "text-halo-width": 1,
  654. "text-halo-blur": 1
  655. }
  656. });
  657. map.addLayer({
  658. "id": "娱乐场所@北京",
  659. "type": "symbol",
  660. "source": "vector-tiles",
  661. "source-layer": "娱乐场所@北京",
  662. "layout": {
  663. "icon-image": "amusement-park-11",
  664. "text-offset": [0, -0.5],
  665. "text-anchor": "bottom",
  666. "text-field": "{NAME}",
  667. "text-size": 12
  668. },
  669. "paint": {
  670. "text-color": "hsl(0, 0%, 0%)",
  671. "text-opacity": 1,
  672. "text-halo-color": "hsl(0, 0%, 100%)",
  673. "text-halo-width": 1,
  674. "text-halo-blur": 1
  675. }
  676. });
  677. map.addLayer({
  678. "id": "大厦@北京",
  679. "type": "symbol",
  680. "source": "vector-tiles",
  681. "source-layer": "大厦@北京",
  682. "layout": {
  683. "icon-image": "picnic-site-11",
  684. "text-offset": [0, -0.5],
  685. "text-anchor": "bottom",
  686. "text-field": "{NAME}",
  687. "text-size": 12
  688. },
  689. "paint": {
  690. "text-color": "hsl(0, 0%, 0%)",
  691. "text-opacity": 1,
  692. "text-halo-color": "hsl(0, 0%, 100%)",
  693. "text-halo-width": 1,
  694. "text-halo-blur": 1
  695. }
  696. });
  697. map.addLayer({
  698. "id": "文化场所@北京",
  699. "type": "symbol",
  700. "source": "vector-tiles",
  701. "source-layer": "文化场所@北京",
  702. "layout": {
  703. "icon-image": "art-gallery-11",
  704. "text-offset": [0, -0.5],
  705. "text-anchor": "bottom",
  706. "text-field": "{NAME}",
  707. "text-size": 12
  708. },
  709. "paint": {
  710. "text-color": "hsl(0, 0%, 0%)",
  711. "text-opacity": 1,
  712. "text-halo-color": "hsl(0, 0%, 100%)",
  713. "text-halo-width": 1,
  714. "text-halo-blur": 1
  715. }
  716. });
  717. map.addLayer({
  718. "id": "运动场所@北京",
  719. "type": "symbol",
  720. "source": "vector-tiles",
  721. "source-layer": "运动场所@北京",
  722. "layout": {
  723. "icon-image": "bicycle-share-11",
  724. "text-offset": [0, -0.5],
  725. "text-anchor": "bottom",
  726. "text-field": "{NAME}",
  727. "text-size": 12
  728. },
  729. "paint": {
  730. "text-color": "hsl(0, 0%, 0%)",
  731. "text-opacity": 1,
  732. "text-halo-color": "hsl(0, 0%, 100%)",
  733. "text-halo-width": 1,
  734. "text-halo-blur": 1
  735. }
  736. });
  737. map.addLayer({
  738. "id": "交通运输@北京",
  739. "type": "symbol",
  740. "source": "vector-tiles",
  741. "source-layer": "交通运输@北京",
  742. "layout": {
  743. "icon-image": "bakery-11",
  744. "text-offset": [0, -0.5],
  745. "text-anchor": "bottom",
  746. "text-field": "{NAME}",
  747. "text-size": 12
  748. },
  749. "paint": {
  750. "text-color": "hsl(0, 0%, 0%)",
  751. "text-opacity": 1,
  752. "text-halo-color": "hsl(0, 0%, 100%)",
  753. "text-halo-width": 1,
  754. "text-halo-blur": 1
  755. }
  756. });
  757. map.addLayer({
  758. "id": "其它@北京",
  759. "type": "symbol",
  760. "source": "vector-tiles",
  761. "source-layer": "其它@北京",
  762. "layout": {
  763. "icon-image": "toilet-11",
  764. "text-offset": [0, -0.5],
  765. "text-anchor": "bottom",
  766. "text-field": "{NAME}",
  767. "text-size": 12
  768. },
  769. "filter": [
  770. "==",
  771. "NAME",
  772. "公厕"
  773. ],
  774. "paint": {
  775. "text-color": "hsl(0, 0%, 0%)",
  776. "text-opacity": 1,
  777. "text-halo-color": "hsl(0, 0%, 100%)",
  778. "text-halo-width": 1,
  779. "text-halo-blur": 1
  780. }
  781. });
  782. map.addLayer({
  783. "id": "服务行业@北京",
  784. "type": "symbol",
  785. "source": "vector-tiles",
  786. "source-layer": "服务行业@北京",
  787. "layout": {
  788. "icon-image": "embassy-11",
  789. "text-offset": [0, -0.5],
  790. "text-anchor": "bottom",
  791. "text-field": "{NAME}",
  792. "text-size": 12
  793. },
  794. "paint": {
  795. "text-color": "hsl(0, 0%, 0%)",
  796. "text-opacity": 1,
  797. "text-halo-color": "hsl(0, 0%, 100%)",
  798. "text-halo-width": 1,
  799. "text-halo-blur": 1
  800. }
  801. });
  802. map.addLayer({
  803. "id": "其它@北京2",
  804. "type": "symbol",
  805. "source": "vector-tiles",
  806. "source-layer": "其它@北京",
  807. "layout": {
  808. "icon-image": "car-11",
  809. "text-offset": [0, -0.5],
  810. "text-anchor": "bottom",
  811. "text-field": "{NAME}",
  812. "text-size": 12
  813. },
  814. "filter": [
  815. "==",
  816. "NAME",
  817. "停车场"
  818. ],
  819. "paint": {
  820. "text-color": "hsl(0, 0%, 0%)",
  821. "text-opacity": 1,
  822. "text-halo-color": "hsl(0, 0%, 100%)",
  823. "text-halo-width": 1,
  824. "text-halo-blur": 1
  825. }
  826. });
  827. map.addLayer({
  828. "id": "邮政电信@北京",
  829. "type": "symbol",
  830. "source": "vector-tiles",
  831. "source-layer": "邮政电信@北京",
  832. "layout": {
  833. "icon-image": "post-11",
  834. "text-offset": [0, -0.5],
  835. "text-anchor": "bottom",
  836. "text-field": "{NAME}",
  837. "text-size": 10,
  838. "text-max-width": 18
  839. },
  840. "paint": {
  841. "text-color": "hsl(0, 0%, 0%)",
  842. "text-opacity": 1,
  843. "text-halo-color": "hsl(0, 0%, 100%)",
  844. "text-halo-width": 1,
  845. "text-halo-blur": 1
  846. }
  847. });
  848. map.addLayer({
  849. "id": "商场@北京",
  850. "type": "symbol",
  851. "source": "vector-tiles",
  852. "source-layer": "商场@北京",
  853. "layout": {
  854. "icon-image": "grocery-11",
  855. "text-offset": [0, -0.5],
  856. "text-anchor": "bottom",
  857. "text-field": "{NAME}",
  858. "text-size": 12
  859. },
  860. "paint": {
  861. "text-color": "hsl(0, 0%, 0%)",
  862. "text-opacity": 1,
  863. "text-halo-color": "hsl(0, 0%, 100%)",
  864. "text-halo-width": 1,
  865. "text-halo-blur": 1
  866. }
  867. });
  868. map.addLayer({
  869. "id": "综合性商店@北京",
  870. "type": "symbol",
  871. "source": "vector-tiles",
  872. "source-layer": "综合性商店@北京",
  873. "layout": {
  874. "icon-image": "grocery-11",
  875. "text-offset": [0, -0.5],
  876. "text-anchor": "bottom",
  877. "text-field": "{NAME}",
  878. "text-size": 12
  879. },
  880. "paint": {
  881. "text-color": "hsl(0, 0%, 0%)",
  882. "text-opacity": 1,
  883. "text-halo-color": "hsl(0, 0%, 100%)",
  884. "text-halo-width": 1,
  885. "text-halo-blur": 1
  886. }
  887. });
  888. map.addLayer({
  889. "id": "饭店@北京",
  890. "type": "symbol",
  891. "source": "vector-tiles",
  892. "source-layer": "饭店@北京",
  893. "layout": {
  894. "icon-image": "restaurant-11",
  895. "text-offset": [0, -0.5],
  896. "text-anchor": "bottom",
  897. "text-field": "{NAME}",
  898. "text-size": 12
  899. },
  900. "paint": {
  901. "text-color": "hsl(0, 0%, 0%)",
  902. "text-opacity": 1,
  903. "text-halo-color": "hsl(0, 0%, 100%)",
  904. "text-halo-width": 1,
  905. "text-halo-blur": 1
  906. }
  907. });
  908. map.addLayer({
  909. "id": "加油站@北京",
  910. "type": "symbol",
  911. "source": "vector-tiles",
  912. "source-layer": "加油站@北京",
  913. "layout": {
  914. "icon-image": "fuel-11",
  915. "text-offset": [0, -0.5],
  916. "text-anchor": "bottom",
  917. "text-field": "{NAME}",
  918. "text-size": 12
  919. },
  920. "paint": {
  921. "text-color": "hsl(0, 0%, 0%)",
  922. "text-opacity": 1,
  923. "text-halo-color": "hsl(0, 0%, 100%)",
  924. "text-halo-width": 1,
  925. "text-halo-blur": 1
  926. }
  927. });
  928. map.addLayer({
  929. "id": "建筑@北京",
  930. "type": "symbol",
  931. "source": "vector-tiles",
  932. "source-layer": "建筑@北京",
  933. "layout": {
  934. "icon-image": "place-of-worship-11",
  935. "text-offset": [0, -0.5],
  936. "text-anchor": "bottom",
  937. "text-field": "{NAME}",
  938. "text-size": 12
  939. },
  940. "paint": {
  941. "text-color": "hsl(0, 0%, 0%)",
  942. "text-opacity": 1,
  943. "text-halo-color": "hsl(0, 0%, 100%)",
  944. "text-halo-width": 1,
  945. "text-halo-blur": 1
  946. }
  947. });
  948. map.addLayer({
  949. "id": "码头@北京",
  950. "type": "symbol",
  951. "source": "vector-tiles",
  952. "source-layer": "码头@北京",
  953. "layout": {
  954. "icon-image": "harbor-11",
  955. "text-offset": [0, -0.5],
  956. "text-anchor": "bottom",
  957. "text-field": "{NAME}",
  958. "text-size": 12
  959. },
  960. "paint": {
  961. "text-color": "hsl(0, 0%, 0%)",
  962. "text-opacity": 1,
  963. "text-halo-color": "hsl(0, 0%, 100%)",
  964. "text-halo-width": 1,
  965. "text-halo-blur": 1
  966. }
  967. });
  968. map.addLayer({
  969. "id": "机场@北京",
  970. "type": "symbol",
  971. "source": "vector-tiles",
  972. "source-layer": "机场@北京",
  973. "layout": {
  974. "icon-image": "airport-11",
  975. "text-offset": [0, -0.5],
  976. "text-anchor": "bottom",
  977. "text-field": "{NAME}",
  978. "text-size": 12
  979. },
  980. "paint": {
  981. "text-color": "hsl(0, 0%, 0%)",
  982. "text-opacity": 1,
  983. "text-halo-color": "hsl(0, 0%, 100%)",
  984. "text-halo-width": 1,
  985. "text-halo-blur": 1
  986. }
  987. });
  988. map.addLayer({
  989. "id": "火车站@北京",
  990. "type": "symbol",
  991. "source": "vector-tiles",
  992. "source-layer": "火车站@北京",
  993. "layout": {
  994. "icon-image": "rail-15",
  995. "text-offset": [0, -0.5],
  996. "text-anchor": "bottom",
  997. "text-field": "{NAME}",
  998. "text-size": 12
  999. },
  1000. "paint": {
  1001. "text-color": "hsl(0, 0%, 0%)",
  1002. "text-opacity": 1,
  1003. "text-halo-color": "hsl(0, 0%, 100%)",
  1004. "text-halo-width": 1,
  1005. "text-halo-blur": 1
  1006. }
  1007. });
  1008. map.addLayer({
  1009. "id": "地名@北京",
  1010. "type": "symbol",
  1011. "source": "vector-tiles",
  1012. "source-layer": "地名@北京",
  1013. "layout": {
  1014. "icon-image": "dot-11",
  1015. "text-offset": [0, -0.3],
  1016. "text-anchor": "bottom",
  1017. "text-field": "{NAME}",
  1018. "text-size": 12
  1019. },
  1020. "paint": {
  1021. "text-color": "hsl(0, 0%, 0%)",
  1022. "text-opacity": 1,
  1023. "text-halo-color": "hsl(0, 0%, 100%)",
  1024. "text-halo-width": 1,
  1025. "text-halo-blur": 1
  1026. }
  1027. });
  1028. });
  1029. </script>
  1030. </body>
  1031. </html>