mvtVectorTile_Beijing_dark.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956
  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_beijingDarkBlueStyle"></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. "sprite": "https://iclient.supermap.io/web/styles/dark/sprite",
  43. "glyphs": host + "/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf",
  44. "layers": []
  45. },
  46. center: [116.4, 39.9],
  47. minZoom: 10,
  48. zoom: 11
  49. });
  50. map.addControl(new mapboxgl.NavigationControl(), 'top-left');
  51. map.on('load', function () {
  52. map.addLayer({
  53. "id": "background",
  54. "type": "background",
  55. "layout": {},
  56. "paint": {
  57. "background-color": "hsl(55, 1%, 20%)"
  58. }
  59. });
  60. map.addLayer({
  61. "id": "面区界R@北京",
  62. "type": "fill",
  63. "source": "vector-tiles",
  64. "source-layer": "面区界R@北京",
  65. "paint": {
  66. "fill-color": "hsl(55, 1%, 20%)",
  67. }
  68. });
  69. map.addLayer({
  70. "id": "界线@北京",
  71. "type": "line",
  72. "source": "vector-tiles",
  73. "source-layer": "界线@北京",
  74. "paint": {
  75. "line-color": "hsl(0, 0%, 35%)",
  76. "line-width": 0.5
  77. }
  78. });
  79. map.addLayer({
  80. "id": "立交桥绿地R@北京",
  81. "type": "fill",
  82. "source": "vector-tiles",
  83. "source-layer": "立交桥绿地R@北京",
  84. "paint": {
  85. "fill-color": "hsl(132, 2%, 20%)",
  86. "fill-opacity": 0.5,
  87. },
  88. });
  89. map.addLayer({
  90. "id": "绿地R@北京",
  91. "type": "fill",
  92. "source": "vector-tiles",
  93. "source-layer": "绿地R@北京",
  94. "paint": {
  95. "fill-color": "hsl(132, 2%, 20%)",
  96. "fill-opacity": 0.5,
  97. },
  98. });
  99. map.addLayer({
  100. "id": " 双线河R@北京",
  101. "type": "fill",
  102. "source": "vector-tiles",
  103. "source-layer": "双线河R@北京",
  104. "paint": {
  105. "fill-color": "hsl(185, 2%, 10%)"
  106. },
  107. });
  108. map.addLayer({
  109. "id": "湖泊、水库R@北京",
  110. "type": "fill",
  111. "source": "vector-tiles",
  112. "source-layer": "湖泊、水库R@北京",
  113. "paint": {
  114. "fill-color": "hsl(185, 2%, 10%)"
  115. },
  116. });
  117. map.addLayer({
  118. "id": " 四级道路L@北京",
  119. "type": "line",
  120. "source": "vector-tiles",
  121. "source-layer": "四级道路L@北京",
  122. "paint": {
  123. "line-width": 1,
  124. "line-color": "hsl(0, 0%, 27%)",
  125. }
  126. });
  127. map.addLayer({
  128. "id": " 三级道路L@北京",
  129. "type": "line",
  130. "source": "vector-tiles",
  131. "source-layer": "三级道路L@北京",
  132. "paint": {
  133. "line-width": 1,
  134. "line-color": "hsl(0, 0%,27%)",
  135. }
  136. });
  137. map.addLayer({
  138. "id": " 二级道路L@北京",
  139. "type": "line",
  140. "source": "vector-tiles",
  141. "source-layer": "二级道路L@北京",
  142. "paint": {
  143. "line-width": 4,
  144. "line-color": "hsl(0, 0%, 17%)",
  145. }
  146. });
  147. map.addLayer({
  148. "id": " 二级道路L@北京1",
  149. "type": "line",
  150. "source": "vector-tiles",
  151. "source-layer": "二级道路L@北京",
  152. "paint": {
  153. "line-width": 2,
  154. "line-color": "hsl(0, 0%, 27%)",
  155. }
  156. });
  157. map.addLayer({
  158. "id": "一级道路L@北京1",
  159. "type": "line",
  160. "source": "vector-tiles",
  161. "source-layer": "一级道路L@北京",
  162. "paint": {
  163. "line-width": 6,
  164. "line-color": "hsl(0, 0%, 17%)",
  165. "line-opacity": {
  166. "base": 1,
  167. "stops": [
  168. [
  169. 10.99,
  170. 0
  171. ],
  172. [
  173. 11,
  174. 1
  175. ]
  176. ]
  177. },
  178. }
  179. });
  180. map.addLayer({
  181. "id": "一级道路L@北京",
  182. "type": "line",
  183. "source": "vector-tiles",
  184. "source-layer": "一级道路L@北京",
  185. "paint": {
  186. "line-width": 4,
  187. "line-color": "hsl(0, 0%, 27%)",
  188. "line-opacity": {
  189. "base": 1,
  190. "stops": [
  191. [
  192. 10.99,
  193. 0
  194. ],
  195. [
  196. 11,
  197. 1
  198. ]
  199. ]
  200. },
  201. }
  202. });
  203. map.addLayer({
  204. "id": " 省道L@北京",
  205. "type": "line",
  206. "source": "vector-tiles",
  207. "source-layer": "省道L@北京",
  208. "paint": {
  209. "line-width": 6,
  210. "line-color": "hsl(0, 0%, 17%)",
  211. },
  212. });
  213. map.addLayer({
  214. "id": " 省道L@北京1",
  215. "type": "line",
  216. "source": "vector-tiles",
  217. "source-layer": "省道L@北京",
  218. "paint": {
  219. "line-width": 4,
  220. "line-color": "hsl(0, 0%, 27%)"
  221. },
  222. });
  223. map.addLayer({
  224. "id": " 高速公路L@北京",
  225. "type": "line",
  226. "source": "vector-tiles",
  227. "source-layer": "高速公路L@北京",
  228. "paint": {
  229. "line-width": 4,
  230. "line-color": "hsl(0, 0%, 27%)",
  231. }
  232. });
  233. //区划
  234. map.addLayer({
  235. "id": "区政府驻地@北京",
  236. "type": "symbol",
  237. "source": "vector-tiles",
  238. "source-layer": "区政府驻地@北京",
  239. "layout": {
  240. "text-offset": [-1.5, -0.5],
  241. "text-anchor": "bottom-left",
  242. "text-field": "{NAME}",
  243. "text-max-width": 7,
  244. "text-size": {
  245. "base": 0.9,
  246. "stops": [
  247. [
  248. 4,
  249. 12
  250. ],
  251. [
  252. 10,
  253. 22
  254. ]
  255. ]
  256. }
  257. },
  258. "paint": {
  259. "text-color": {
  260. "base": 1,
  261. "stops": [
  262. [
  263. 10,
  264. "hsl(0, 0%, 75%)"
  265. ],
  266. [
  267. 11,
  268. "hsl(0, 0%, 85%)"
  269. ]
  270. ]
  271. },
  272. "text-halo-color": "hsla(0, 0%, 10%, 0.75)",
  273. "text-halo-width": 1.25,
  274. "text-opacity": {
  275. "base": 1,
  276. "stops": [
  277. [
  278. 11.99,
  279. 1
  280. ],
  281. [
  282. 12,
  283. 0
  284. ]
  285. ]
  286. },
  287. "text-halo-blur": 0
  288. },
  289. });
  290. //地标
  291. map.addLayer({
  292. "id": "标志建筑@北京",
  293. "type": "symbol",
  294. "source": "vector-tiles",
  295. "source-layer": "标志建筑@北京",
  296. "layout": {
  297. "text-offset": [-1.5, -0.5],
  298. "text-anchor": "bottom-left",
  299. "text-field": "{NAME}",
  300. "text-max-width": 7,
  301. "text-size": 14
  302. },
  303. "paint": {
  304. "text-color": "hsl(0, 0%, 60%)",
  305. "text-halo-color": "#212121",
  306. "text-halo-width": 1,
  307. "text-halo-blur": 0,
  308. "text-opacity": {
  309. "base": 1,
  310. "stops": [
  311. [
  312. 10.99,
  313. 0
  314. ],
  315. [
  316. 11,
  317. 1
  318. ]
  319. ]
  320. },
  321. }
  322. });
  323. map.addLayer({
  324. "id": " 一级道路Name",
  325. "type": "symbol",
  326. "source": "vector-tiles",
  327. "source-layer": "一级道路L@北京",
  328. "layout": {
  329. "text-line-height": 1.1,
  330. "text-size": {
  331. "base": 1.5,
  332. "stops": [
  333. [
  334. 13.99,
  335. 12
  336. ],
  337. [
  338. 20,
  339. 24
  340. ]
  341. ]
  342. },
  343. "text-font": [
  344. "DIN Offc Pro Italic",
  345. "Arial Unicode MS Regular"
  346. ],
  347. "symbol-placement": "line",
  348. "text-field": "{道路名称}",
  349. "text-letter-spacing": 0.1,
  350. "text-max-width": 5
  351. },
  352. "paint": {
  353. "text-color": "hsl(0, 0%, 0%)",
  354. "text-halo-color": "hsl(0, 0%, 100%)",
  355. "text-halo-width": 1.25,
  356. "text-opacity": {
  357. "base": 1,
  358. "stops": [
  359. [
  360. 13.99,
  361. 0
  362. ],
  363. [
  364. 14,
  365. 1
  366. ]
  367. ]
  368. },
  369. },
  370. });
  371. map.addLayer({
  372. "id": " 省道Name",
  373. "type": "symbol",
  374. "source": "vector-tiles",
  375. "source-layer": "省道L@北京",
  376. "layout": {
  377. "text-line-height": 1.1,
  378. "text-size": {
  379. "base": 1.5,
  380. "stops": [
  381. [
  382. 11,
  383. 10
  384. ],
  385. [
  386. 18,
  387. 24
  388. ]
  389. ]
  390. },
  391. "text-font": [
  392. "DIN Offc Pro Italic",
  393. "Arial Unicode MS Regular"
  394. ],
  395. "symbol-placement": "line",
  396. "text-field": "{道路名称}",
  397. "text-letter-spacing": 0.1,
  398. "text-max-width": 5
  399. },
  400. "paint": {
  401. "text-color": "hsl(0, 0%, 0%)",
  402. "text-halo-color": "hsl(0, 0%, 100%)",
  403. "text-halo-width": 1.25,
  404. "text-opacity": {
  405. "base": 1,
  406. "stops": [
  407. [
  408. 10.99,
  409. 0
  410. ],
  411. [
  412. 11,
  413. 1
  414. ]
  415. ]
  416. },
  417. },
  418. });
  419. map.addLayer({
  420. "id": "立交桥名称P@北京",
  421. "type": "symbol",
  422. "source": "vector-tiles",
  423. "source-layer": "立交桥名称P@北京",
  424. "layout": {
  425. "text-offset": [-1, -1],
  426. "text-anchor": "bottom",
  427. "text-field": "{NAME}",
  428. "text-size": 14
  429. },
  430. "paint": {
  431. "text-color": "hsl(0, 0%, 78%)",
  432. "text-opacity": 1,
  433. "text-halo-color": "#212121",
  434. "text-halo-width": 1,
  435. "text-halo-blur": 0
  436. }
  437. });
  438. map.addLayer({
  439. "id": "长途汽车站@北京",
  440. "type": "symbol",
  441. "source": "vector-tiles",
  442. "source-layer": "长途汽车站@北京",
  443. "layout": {
  444. "icon-image": "bus-11",
  445. "text-offset": [-1, -1],
  446. "text-anchor": "bottom",
  447. "text-field": "{NAME}",
  448. "text-size": 12
  449. },
  450. "paint": {
  451. "text-color": "hsl(0, 0%, 78%)",
  452. "text-halo-color": "#212121",
  453. "text-halo-width": 1,
  454. "text-halo-blur": 0
  455. },
  456. });
  457. map.addLayer({
  458. "id": "图书馆@北京",
  459. "type": "symbol",
  460. "source": "vector-tiles",
  461. "source-layer": "图书馆@北京",
  462. "layout": {
  463. "icon-image": "library-11",
  464. "text-offset": [-1, -1],
  465. "text-anchor": "bottom",
  466. "text-field": "{NAME}",
  467. "text-size": 12
  468. },
  469. "paint": {
  470. "text-color": "hsl(0, 0%, 78%)",
  471. "text-halo-color": "#212121",
  472. "text-halo-width": 1,
  473. "text-halo-blur": 0
  474. },
  475. });
  476. map.addLayer({
  477. "id": "公园@北京",
  478. "type": "symbol",
  479. "source": "vector-tiles",
  480. "source-layer": "公园@北京",
  481. "layout": {
  482. "icon-image": "park-11",
  483. "text-offset": [0, -0.5],
  484. "text-anchor": "bottom",
  485. "text-field": "{NAME}",
  486. "text-size": 12
  487. },
  488. "paint": {
  489. "text-color": "hsl(0, 0%, 78%)",
  490. "text-halo-color": "#212121",
  491. "text-halo-width": 1,
  492. "text-halo-blur": 0
  493. },
  494. });
  495. map.addLayer({
  496. "id": "综合性广场@北京",
  497. "type": "symbol",
  498. "source": "vector-tiles",
  499. "source-layer": "综合性广场@北京",
  500. "layout": {
  501. "icon-image": "campsite-11",
  502. "text-offset": [0, -0.5],
  503. "text-anchor": "bottom",
  504. "text-field": "{NAME}",
  505. "text-size": 12
  506. },
  507. "paint": {
  508. "text-color": "hsl(0, 0%, 78%)",
  509. "text-halo-color": "#212121",
  510. "text-halo-width": 1,
  511. "text-halo-blur": 0
  512. },
  513. });
  514. map.addLayer({
  515. "id": "旅游景点@北京",
  516. "type": "symbol",
  517. "source": "vector-tiles",
  518. "source-layer": "旅游景点@北京",
  519. "layout": {
  520. "icon-image": "volcano-11",
  521. "text-offset": [0, -0.5],
  522. "text-anchor": "bottom",
  523. "text-field": "{NAME}",
  524. "text-size": 12
  525. },
  526. "paint": {
  527. "text-color": "hsl(0, 0%, 78%)",
  528. "text-halo-color": "#212121",
  529. "text-halo-width": 1,
  530. "text-halo-blur": 0
  531. },
  532. });
  533. map.addLayer({
  534. "id": "医疗卫生@北京",
  535. "type": "symbol",
  536. "source": "vector-tiles",
  537. "source-layer": "医疗卫生@北京",
  538. "layout": {
  539. "icon-image": "hospital-11",
  540. "text-offset": [0, -0.5],
  541. "text-anchor": "bottom",
  542. "text-field": "{NAME}",
  543. "text-size": 12
  544. },
  545. "paint": {
  546. "text-color": "hsl(0, 0%, 78%)",
  547. "text-halo-color": "#212121",
  548. "text-halo-width": 1,
  549. "text-halo-blur": 0
  550. }
  551. });
  552. map.addLayer({
  553. "id": "娱乐场所@北京",
  554. "type": "symbol",
  555. "source": "vector-tiles",
  556. "source-layer": "娱乐场所@北京",
  557. "layout": {
  558. "icon-image": "amusement-park-11",
  559. "text-offset": [0, -0.5],
  560. "text-anchor": "bottom",
  561. "text-field": "{NAME}",
  562. "text-size": 12
  563. },
  564. "paint": {
  565. "text-color": "hsl(0, 0%, 0%)",
  566. "text-opacity": 1,
  567. "text-halo-color": "hsl(0, 0%, 100%)",
  568. "text-halo-width": 1,
  569. "text-halo-blur": 1
  570. }
  571. });
  572. map.addLayer({
  573. "id": "大厦@北京",
  574. "type": "symbol",
  575. "source": "vector-tiles",
  576. "source-layer": "大厦@北京",
  577. "layout": {
  578. "icon-image": "picnic-site-11",
  579. "text-offset": [0, -0.5],
  580. "text-anchor": "bottom",
  581. "text-field": "{NAME}",
  582. "text-size": 12
  583. },
  584. "paint": {
  585. "text-color": "hsl(0, 0%, 0%)",
  586. "text-opacity": 1,
  587. "text-halo-color": "hsl(0, 0%, 100%)",
  588. "text-halo-width": 1,
  589. "text-halo-blur": 1
  590. }
  591. });
  592. map.addLayer({
  593. "id": "文化场所@北京",
  594. "type": "symbol",
  595. "source": "vector-tiles",
  596. "source-layer": "文化场所@北京",
  597. "layout": {
  598. "icon-image": "art-gallery-11",
  599. "text-offset": [0, -0.5],
  600. "text-anchor": "bottom",
  601. "text-field": "{NAME}",
  602. "text-size": 12
  603. },
  604. "paint": {
  605. "text-color": "hsl(0, 0%, 0%)",
  606. "text-opacity": 1,
  607. "text-halo-color": "hsl(0, 0%, 100%)",
  608. "text-halo-width": 1,
  609. "text-halo-blur": 1
  610. }
  611. });
  612. map.addLayer({
  613. "id": "运动场所@北京",
  614. "type": "symbol",
  615. "source": "vector-tiles",
  616. "source-layer": "运动场所@北京",
  617. "layout": {
  618. "icon-image": "bicycle-share-11",
  619. "text-offset": [0, -0.5],
  620. "text-anchor": "bottom",
  621. "text-field": "{NAME}",
  622. "text-size": 12
  623. },
  624. "paint": {
  625. "text-color": "hsl(0, 0%, 0%)",
  626. "text-opacity": 1,
  627. "text-halo-color": "hsl(0, 0%, 100%)",
  628. "text-halo-width": 1,
  629. "text-halo-blur": 1
  630. }
  631. });
  632. map.addLayer({
  633. "id": "交通运输@北京",
  634. "type": "symbol",
  635. "source": "vector-tiles",
  636. "source-layer": "交通运输@北京",
  637. "layout": {
  638. "icon-image": "bakery-11",
  639. "text-offset": [0, -0.5],
  640. "text-anchor": "bottom",
  641. "text-field": "{NAME}",
  642. "text-size": 12
  643. },
  644. "paint": {
  645. "text-color": "hsl(0, 0%, 0%)",
  646. "text-opacity": 1,
  647. "text-halo-color": "hsl(0, 0%, 100%)",
  648. "text-halo-width": 1,
  649. "text-halo-blur": 1
  650. }
  651. });
  652. map.addLayer({
  653. "id": "其它@北京",
  654. "type": "symbol",
  655. "source": "vector-tiles",
  656. "source-layer": "其它@北京",
  657. "layout": {
  658. "icon-image": "toilet-11",
  659. "text-offset": [0, -0.5],
  660. "text-anchor": "bottom",
  661. "text-field": "{NAME}",
  662. "text-size": 12
  663. },
  664. "filter": [
  665. "==",
  666. "NAME",
  667. "公厕"
  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": "embassy-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": "其它@北京2",
  699. "type": "symbol",
  700. "source": "vector-tiles",
  701. "source-layer": "其它@北京",
  702. "layout": {
  703. "icon-image": "car-11",
  704. "text-offset": [0, -0.5],
  705. "text-anchor": "bottom",
  706. "text-field": "{NAME}",
  707. "text-size": 12
  708. },
  709. "filter": [
  710. "==",
  711. "NAME",
  712. "停车场"
  713. ],
  714. "paint": {
  715. "text-color": "hsl(0, 0%, 0%)",
  716. "text-opacity": 1,
  717. "text-halo-color": "hsl(0, 0%, 100%)",
  718. "text-halo-width": 1,
  719. "text-halo-blur": 1
  720. }
  721. });
  722. map.addLayer({
  723. "id": "邮政电信@北京",
  724. "type": "symbol",
  725. "source": "vector-tiles",
  726. "source-layer": "邮政电信@北京",
  727. "layout": {
  728. "icon-image": "post-11",
  729. "text-offset": [0, -0.5],
  730. "text-anchor": "bottom",
  731. "text-field": "{NAME}",
  732. "text-size": 10,
  733. "text-max-width": 18
  734. },
  735. "paint": {
  736. "text-color": "hsl(0, 0%, 0%)",
  737. "text-opacity": 1,
  738. "text-halo-color": "hsl(0, 0%, 100%)",
  739. "text-halo-width": 1,
  740. "text-halo-blur": 1
  741. }
  742. });
  743. map.addLayer({
  744. "id": "商场@北京",
  745. "type": "symbol",
  746. "source": "vector-tiles",
  747. "source-layer": "商场@北京",
  748. "layout": {
  749. "icon-image": "grocery-11",
  750. "text-offset": [0, -0.5],
  751. "text-anchor": "bottom",
  752. "text-field": "{NAME}",
  753. "text-size": 12
  754. },
  755. "paint": {
  756. "text-color": "hsl(0, 0%, 78%)",
  757. "text-halo-color": "#212121",
  758. "text-halo-width": 1,
  759. "text-halo-blur": 0
  760. }
  761. });
  762. map.addLayer({
  763. "id": "综合性商店@北京",
  764. "type": "symbol",
  765. "source": "vector-tiles",
  766. "source-layer": "综合性商店@北京",
  767. "layout": {
  768. "icon-image": "grocery-11",
  769. "text-offset": [0, -0.5],
  770. "text-anchor": "bottom",
  771. "text-field": "{NAME}",
  772. "text-size": 12
  773. },
  774. "paint": {
  775. "text-color": "hsl(0, 0%, 78%)",
  776. "text-halo-color": "#212121",
  777. "text-halo-width": 1,
  778. "text-halo-blur": 0
  779. }
  780. });
  781. map.addLayer({
  782. "id": "饭店@北京",
  783. "type": "symbol",
  784. "source": "vector-tiles",
  785. "source-layer": "饭店@北京",
  786. "layout": {
  787. "icon-image": "restaurant-11",
  788. "text-offset": [0, -0.5],
  789. "text-anchor": "bottom",
  790. "text-field": "{NAME}",
  791. "text-size": 12
  792. },
  793. "paint": {
  794. "text-color": "hsl(0, 0%, 78%)",
  795. "text-halo-color": "#212121",
  796. "text-halo-width": 1,
  797. "text-halo-blur": 0
  798. }
  799. });
  800. map.addLayer({
  801. "id": "加油站@北京",
  802. "type": "symbol",
  803. "source": "vector-tiles",
  804. "source-layer": "加油站@北京",
  805. "layout": {
  806. "icon-image": "fuel-11",
  807. "text-offset": [0, -0.5],
  808. "text-anchor": "bottom",
  809. "text-field": "{NAME}",
  810. "text-size": 12
  811. },
  812. "paint": {
  813. "text-color": "hsl(0, 0%, 78%)",
  814. "text-halo-color": "#212121",
  815. "text-halo-width": 1,
  816. "text-halo-blur": 0
  817. }
  818. });
  819. map.addLayer({
  820. "id": "建筑@北京",
  821. "type": "symbol",
  822. "source": "vector-tiles",
  823. "source-layer": "建筑@北京",
  824. "layout": {
  825. "icon-image": "place-of-worship-11",
  826. "text-offset": [0, -0.5],
  827. "text-anchor": "bottom",
  828. "text-field": "{NAME}",
  829. "text-size": 12
  830. },
  831. "paint": {
  832. "text-color": "hsl(0, 0%, 78%)",
  833. "text-halo-color": "#212121",
  834. "text-halo-width": 1,
  835. "text-halo-blur": 0
  836. }
  837. });
  838. map.addLayer({
  839. "id": "码头@北京",
  840. "type": "symbol",
  841. "source": "vector-tiles",
  842. "source-layer": "码头@北京",
  843. "layout": {
  844. "icon-image": "harbor-11",
  845. "text-offset": [0, -0.5],
  846. "text-anchor": "bottom",
  847. "text-field": "{NAME}",
  848. "text-size": 12
  849. },
  850. "paint": {
  851. "text-color": "hsl(0, 0%, 78%)",
  852. "text-halo-color": "#212121",
  853. "text-halo-width": 1,
  854. "text-halo-blur": 0
  855. }
  856. });
  857. map.addLayer({
  858. "id": "机场@北京",
  859. "type": "symbol",
  860. "source": "vector-tiles",
  861. "source-layer": "机场@北京",
  862. "layout": {
  863. "icon-image": "airport-11",
  864. "text-offset": [0, -0.5],
  865. "text-anchor": "bottom",
  866. "text-field": "{NAME}",
  867. "text-size": 12
  868. },
  869. "paint": {
  870. "text-color": "hsl(0, 0%, 78%)",
  871. "text-halo-color": "#212121",
  872. "text-halo-width": 1,
  873. "text-halo-blur": 0
  874. }
  875. });
  876. map.addLayer({
  877. "id": "火车站@北京",
  878. "type": "symbol",
  879. "source": "vector-tiles",
  880. "source-layer": "火车站@北京",
  881. "layout": {
  882. "icon-image": "rail-15",
  883. "text-offset": [0, -0.5],
  884. "text-anchor": "bottom",
  885. "text-field": "{NAME}",
  886. "text-size": 12
  887. },
  888. "paint": {
  889. "text-color": "hsl(0, 0%, 78%)",
  890. "text-halo-color": "#212121",
  891. "text-halo-width": 1,
  892. "text-halo-blur": 0
  893. }
  894. });
  895. map.addLayer({
  896. "id": "地名@北京",
  897. "type": "symbol",
  898. "source": "vector-tiles",
  899. "source-layer": "地名@北京",
  900. "layout": {
  901. "icon-image": "dot-11",
  902. "text-offset": [0, -0.3],
  903. "text-anchor": "bottom",
  904. "text-field": "{NAME}",
  905. "text-size": 12
  906. },
  907. "paint": {
  908. "text-color": "hsl(0, 0%, 78%)",
  909. "text-halo-color": "#212121",
  910. "text-halo-width": 1,
  911. "text-halo-blur": 0
  912. }
  913. });
  914. });
  915. </script>
  916. </body>
  917. </html>