mvtVectorTile_Beijing_OSM.html 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296
  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_beijingOSMStyle"></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/osm/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": "#f8f4f0"
  58. }
  59. });
  60. map.addLayer({
  61. "id": "界线@北京",
  62. "type": "line",
  63. "source": "vector-tiles",
  64. "source-layer": "界线@北京",
  65. "layout": {
  66. "line-join": "round"
  67. },
  68. "paint": {
  69. "line-color": "#9e9cab",
  70. "line-dasharray": [
  71. 3,
  72. 1,
  73. 1,
  74. 1
  75. ],
  76. "line-width": {
  77. "base": 1.4,
  78. "stops": [
  79. [
  80. 4,
  81. 0.4
  82. ],
  83. [
  84. 5,
  85. 1
  86. ],
  87. [
  88. 12,
  89. 3
  90. ]
  91. ]
  92. }
  93. }
  94. });
  95. map.addLayer({
  96. "id": "立交桥绿地R@北京",
  97. "type": "fill",
  98. "source": "vector-tiles",
  99. "source-layer": "立交桥绿地R@北京",
  100. "paint": {
  101. "fill-color": "#6a4",
  102. "fill-opacity": 0.1,
  103. "fill-outline-color": "hsla(0, 0%, 0%, 0.03)",
  104. "fill-antialias": true
  105. }
  106. });
  107. map.addLayer({
  108. "id": "绿地R@北京",
  109. "type": "fill",
  110. "source": "vector-tiles",
  111. "source-layer": "绿地R@北京",
  112. "paint": {
  113. "fill-color": "#d8e8c8",
  114. "fill-opacity": 1
  115. }
  116. });
  117. map.addLayer({
  118. "id": " 双线河R@北京",
  119. "type": "fill",
  120. "source": "vector-tiles",
  121. "source-layer": "双线河R@北京",
  122. "paint": {
  123. "fill-color": "hsl(210, 67%, 85%)"
  124. }
  125. });
  126. map.addLayer({
  127. "id": "湖泊、水库R@北京",
  128. "type": "fill",
  129. "source": "vector-tiles",
  130. "source-layer": "湖泊、水库R@北京",
  131. "paint": {
  132. "fill-color": "hsl(210, 67%, 85%)"
  133. }
  134. });
  135. map.addLayer({
  136. "id": " 四级道路L@北京1",
  137. "type": "line",
  138. "source": "vector-tiles",
  139. "source-layer": "四级道路L@北京",
  140. "layout": {
  141. "line-cap": "round",
  142. "line-join": "round"
  143. },
  144. "paint": {
  145. "line-color": "#cfcdca",
  146. "line-opacity": 1,
  147. "line-width": {
  148. "base": 1.2,
  149. "stops": [
  150. [
  151. 12,
  152. 0.5
  153. ],
  154. [
  155. 13,
  156. 1
  157. ],
  158. [
  159. 14,
  160. 4
  161. ],
  162. [
  163. 20,
  164. 15
  165. ]
  166. ]
  167. }
  168. }
  169. });
  170. map.addLayer({
  171. "id": " 四级道路L@北京",
  172. "type": "line",
  173. "source": "vector-tiles",
  174. "source-layer": "四级道路L@北京",
  175. "layout": {
  176. "line-cap": "round",
  177. "line-join": "round"
  178. },
  179. "paint": {
  180. "line-color": "#fff",
  181. "line-opacity": 1,
  182. "line-width": {
  183. "base": 1.2,
  184. "stops": [
  185. [
  186. 13.5,
  187. 0
  188. ],
  189. [
  190. 14,
  191. 2.5
  192. ],
  193. [
  194. 20,
  195. 11.5
  196. ]
  197. ]
  198. }
  199. }
  200. });
  201. map.addLayer({
  202. "id": " 三级道路L@北京1",
  203. "type": "line",
  204. "source": "vector-tiles",
  205. "source-layer": "三级道路L@北京",
  206. "layout": {
  207. "line-cap": "round",
  208. "line-join": "round"
  209. },
  210. "paint": {
  211. "line-color": "#cfcdca",
  212. "line-opacity": 1,
  213. "line-width": {
  214. "base": 1.2,
  215. "stops": [
  216. [
  217. 12,
  218. 0.5
  219. ],
  220. [
  221. 13,
  222. 1
  223. ],
  224. [
  225. 14,
  226. 4
  227. ],
  228. [
  229. 20,
  230. 15
  231. ]
  232. ]
  233. }
  234. }
  235. });
  236. map.addLayer({
  237. "id": " 三级道路L@北京",
  238. "type": "line",
  239. "source": "vector-tiles",
  240. "source-layer": "三级道路L@北京",
  241. "layout": {
  242. "line-cap": "round",
  243. "line-join": "round"
  244. },
  245. "paint": {
  246. "line-color": "#fff",
  247. "line-opacity": 1,
  248. "line-width": {
  249. "base": 1.2,
  250. "stops": [
  251. [
  252. 13.5,
  253. 0
  254. ],
  255. [
  256. 14,
  257. 2.5
  258. ],
  259. [
  260. 20,
  261. 11.5
  262. ]
  263. ]
  264. }
  265. }
  266. });
  267. map.addLayer({
  268. "id": "二级道路L@北京",
  269. "type": "line",
  270. "source": "vector-tiles",
  271. "source-layer": "二级道路L@北京",
  272. "layout": {
  273. "line-cap": "round",
  274. "line-join": "round",
  275. "visibility": "visible"
  276. },
  277. "paint": {
  278. "line-color": "#e9ac77",
  279. "line-opacity": 1,
  280. "line-width": {
  281. "base": 1.2,
  282. "stops": [
  283. [
  284. 8,
  285. 1.5
  286. ],
  287. [
  288. 20,
  289. 17
  290. ]
  291. ]
  292. }
  293. }
  294. });
  295. map.addLayer({
  296. "id": "二级道路L@北京1",
  297. "type": "line",
  298. "source": "vector-tiles",
  299. "source-layer": "二级道路L@北京",
  300. "layout": {
  301. "line-cap": "round",
  302. "line-join": "round",
  303. "visibility": "visible"
  304. },
  305. "paint": {
  306. "line-color": "#fea",
  307. "line-width": {
  308. "base": 1.2,
  309. "stops": [
  310. [
  311. 8,
  312. 0.5
  313. ],
  314. [
  315. 20,
  316. 13
  317. ]
  318. ]
  319. }
  320. }
  321. });
  322. map.addLayer({
  323. "id": " 一级道路L@北京",
  324. "type": "line",
  325. "source": "vector-tiles",
  326. "source-layer": "一级道路L@北京",
  327. "layout": {
  328. "line-cap": "round",
  329. "line-join": "round",
  330. "visibility": "visible"
  331. },
  332. "paint": {
  333. "line-color": "#e9ac77",
  334. "line-opacity": 1,
  335. "line-width": {
  336. "base": 1.2,
  337. "stops": [
  338. [
  339. 7,
  340. 1.5
  341. ],
  342. [
  343. 20,
  344. 22
  345. ]
  346. ]
  347. }
  348. }
  349. });
  350. map.addLayer({
  351. "id": " 一级道路L@北京1",
  352. "type": "line",
  353. "source": "vector-tiles",
  354. "source-layer": "一级道路L@北京",
  355. "layout": {
  356. "line-cap": "round",
  357. "line-join": "round",
  358. "visibility": "visible"
  359. },
  360. "paint": {
  361. "line-color": "#fea",
  362. "line-width": {
  363. "base": 1.2,
  364. "stops": [
  365. [
  366. 7,
  367. 0.5
  368. ],
  369. [
  370. 20,
  371. 18
  372. ]
  373. ]
  374. }
  375. }
  376. });
  377. map.addLayer({
  378. "id": " 省道L@北京",
  379. "type": "line",
  380. "source": "vector-tiles",
  381. "source-layer": "省道L@北京",
  382. "paint": {
  383. "line-color": "#e9ac77",
  384. "line-opacity": {
  385. "stops": [
  386. [
  387. 5,
  388. 0
  389. ],
  390. [
  391. 6,
  392. 1
  393. ]
  394. ]
  395. },
  396. "line-width": {
  397. "base": 1.2,
  398. "stops": [
  399. [
  400. 7,
  401. 1.5
  402. ],
  403. [
  404. 20,
  405. 22
  406. ]
  407. ]
  408. }
  409. }
  410. });
  411. map.addLayer({
  412. "id": " 省道L@北京1",
  413. "type": "line",
  414. "source": "vector-tiles",
  415. "source-layer": "省道L@北京",
  416. "layout": {
  417. "line-cap": "round",
  418. "line-join": "round",
  419. "visibility": "visible"
  420. },
  421. "paint": {
  422. "line-color": "#fea",
  423. "line-width": {
  424. "base": 1.2,
  425. "stops": [
  426. [
  427. 7,
  428. 0.5
  429. ],
  430. [
  431. 20,
  432. 18
  433. ]
  434. ]
  435. }
  436. }
  437. });
  438. map.addLayer({
  439. "id": " 高速公路L@北京",
  440. "type": "line",
  441. "source": "vector-tiles",
  442. "source-layer": "高速公路L@北京",
  443. "layout": {
  444. "line-cap": "round",
  445. "line-join": "round",
  446. "visibility": "visible"
  447. },
  448. "paint": {
  449. "line-color": "#e9ac77",
  450. "line-width": {
  451. "base": 1.2,
  452. "stops": [
  453. [
  454. 7,
  455. 1.5
  456. ],
  457. [
  458. 20,
  459. 22
  460. ]
  461. ]
  462. },
  463. "line-opacity": 1
  464. }
  465. });
  466. map.addLayer({
  467. "id": " 高速公路L@北京1",
  468. "type": "line",
  469. "source": "vector-tiles",
  470. "source-layer": "高速公路L@北京",
  471. "layout": {
  472. "line-cap": "round",
  473. "line-join": "round",
  474. "visibility": "visible"
  475. },
  476. "paint": {
  477. "line-color": "#fc8",
  478. "line-width": {
  479. "base": 1.2,
  480. "stops": [
  481. [
  482. 7,
  483. 0.5
  484. ],
  485. [
  486. 20,
  487. 18
  488. ]
  489. ]
  490. }
  491. }
  492. });
  493. map.addLayer({
  494. "id": "区政府驻地@北京",
  495. "type": "symbol",
  496. "source": "vector-tiles",
  497. "source-layer": "区政府驻地@北京",
  498. "layout": {
  499. "text-offset": [-1.5, -0.5],
  500. "text-anchor": "bottom-left",
  501. "text-field": "{NAME}",
  502. "text-max-width": 7,
  503. "text-font": [
  504. "DIN Offc Pro Medium",
  505. "Arial Unicode MS Regular"
  506. ],
  507. "text-size": 22
  508. },
  509. "paint": {
  510. "text-color": "hsl(230, 8%, 62%)",
  511. "text-opacity": {
  512. "base": 1,
  513. "stops": [
  514. [
  515. 11.99,
  516. 1
  517. ],
  518. [
  519. 12,
  520. 0
  521. ]
  522. ]
  523. },
  524. "text-halo-color": "#ffffff",
  525. "text-halo-width": 1,
  526. "text-halo-blur": 1
  527. }
  528. });
  529. map.addLayer({
  530. "id": "标志建筑@北京",
  531. "type": "symbol",
  532. "source": "vector-tiles",
  533. "source-layer": "标志建筑@北京",
  534. "layout": {
  535. "text-offset": [-1.5, -0.5],
  536. "text-anchor": "bottom-left",
  537. "text-field": "{NAME}",
  538. "text-max-width": 7,
  539. "text-size": 14
  540. },
  541. "paint": {
  542. "text-color": "hsl(26, 25%, 32%)",
  543. "text-opacity": {
  544. "base": 1,
  545. "stops": [
  546. [
  547. 10.99,
  548. 0
  549. ],
  550. [
  551. 11,
  552. 1
  553. ]
  554. ]
  555. },
  556. "text-halo-color": "#ffffff",
  557. "text-halo-width": 1,
  558. "text-halo-blur": 1
  559. }
  560. });
  561. map.addLayer({
  562. "id": " 四级道路Name",
  563. "type": "symbol",
  564. "source": "vector-tiles",
  565. "source-layer": "四级道路L@北京",
  566. "layout": {
  567. "text-size": {
  568. "base": 1,
  569. "stops": [
  570. [
  571. 13,
  572. 12
  573. ],
  574. [
  575. 14,
  576. 13
  577. ]
  578. ]
  579. },
  580. "text-field": "{道路名称}",
  581. "symbol-placement": "line",
  582. "text-rotation-alignment": "map"
  583. },
  584. "paint": {
  585. "text-halo-blur": 0.5,
  586. "text-color": "#765",
  587. "text-opacity": {
  588. "base": 1,
  589. "stops": [
  590. [
  591. 14.99,
  592. 0
  593. ],
  594. [
  595. 15,
  596. 1
  597. ]
  598. ]
  599. },
  600. "text-halo-width": 1
  601. }
  602. });
  603. map.addLayer({
  604. "id": " 三级道路Name",
  605. "type": "symbol",
  606. "source": "vector-tiles",
  607. "source-layer": "三级道路L@北京",
  608. "layout": {
  609. "text-size": {
  610. "base": 1,
  611. "stops": [
  612. [
  613. 13,
  614. 12
  615. ],
  616. [
  617. 14,
  618. 13
  619. ]
  620. ]
  621. },
  622. "text-field": "{道路名称}",
  623. "symbol-placement": "line",
  624. "text-rotation-alignment": "map"
  625. },
  626. "paint": {
  627. "text-halo-blur": 0.5,
  628. "text-color": "#765",
  629. "text-halo-width": 1
  630. }
  631. });
  632. map.addLayer({
  633. "id": " 二级道路Name",
  634. "type": "symbol",
  635. "source": "vector-tiles",
  636. "source-layer": "二级道路L@北京",
  637. "layout": {
  638. "text-size": {
  639. "base": 1,
  640. "stops": [
  641. [
  642. 13,
  643. 12
  644. ],
  645. [
  646. 14,
  647. 13
  648. ]
  649. ]
  650. },
  651. "text-field": "{道路名称}",
  652. "symbol-placement": "line",
  653. "text-rotation-alignment": "map"
  654. },
  655. "paint": {
  656. "text-halo-blur": 0.5,
  657. "text-color": "#765",
  658. "text-halo-width": 1
  659. }
  660. });
  661. map.addLayer({
  662. "id": " 一级道路Name",
  663. "type": "symbol",
  664. "source": "vector-tiles",
  665. "source-layer": "一级道路L@北京",
  666. "layout": {
  667. "text-size": {
  668. "base": 1,
  669. "stops": [
  670. [
  671. 13,
  672. 12
  673. ],
  674. [
  675. 14,
  676. 13
  677. ]
  678. ]
  679. },
  680. "text-field": "{道路名称}",
  681. "symbol-placement": "line",
  682. "text-rotation-alignment": "map"
  683. },
  684. "paint": {
  685. "text-halo-blur": 0.5,
  686. "text-color": "#765",
  687. "text-opacity": {
  688. "base": 1,
  689. "stops": [
  690. [
  691. 13.99,
  692. 0
  693. ],
  694. [
  695. 14,
  696. 1
  697. ]
  698. ]
  699. },
  700. "text-halo-width": 1
  701. }
  702. });
  703. map.addLayer({
  704. "id": " 省道Name",
  705. "type": "symbol",
  706. "source": "vector-tiles",
  707. "source-layer": "省道L@北京",
  708. "layout": {
  709. "text-size": {
  710. "base": 1,
  711. "stops": [
  712. [
  713. 13,
  714. 12
  715. ],
  716. [
  717. 14,
  718. 13
  719. ]
  720. ]
  721. },
  722. "text-field": "{道路名称}",
  723. "symbol-placement": "line",
  724. "text-rotation-alignment": "map"
  725. },
  726. "paint": {
  727. "text-halo-blur": 0.5,
  728. "text-color": "#765",
  729. "text-halo-width": 1,
  730. "text-opacity": {
  731. "base": 1,
  732. "stops": [
  733. [
  734. 12.99,
  735. 0
  736. ],
  737. [
  738. 13,
  739. 1
  740. ]
  741. ]
  742. },
  743. }
  744. });
  745. map.addLayer({
  746. "id": "立交桥名称P@北京",
  747. "type": "symbol",
  748. "source": "vector-tiles",
  749. "source-layer": "立交桥名称P@北京",
  750. "layout": {
  751. "text-offset": [-1, -1],
  752. "text-anchor": "bottom",
  753. "text-field": "{NAME}",
  754. "text-size": 12
  755. },
  756. "paint": {
  757. "text-color": "#666",
  758. "text-opacity": 1,
  759. "text-halo-color": "#ffffff",
  760. "text-halo-width": 1,
  761. "text-halo-blur": 1
  762. }
  763. });
  764. map.addLayer({
  765. "id": "长途汽车站@北京",
  766. "type": "symbol",
  767. "source": "vector-tiles",
  768. "source-layer": "长途汽车站@北京",
  769. "layout": {
  770. "icon-image": "bus_11",
  771. "text-offset": [-1, -1],
  772. "text-anchor": "bottom",
  773. "text-field": "{NAME}",
  774. "text-size": 12
  775. },
  776. "paint": {
  777. "text-color": "#666",
  778. "text-opacity": 1,
  779. "text-halo-color": "#ffffff",
  780. "text-halo-width": 1,
  781. "text-halo-blur": 1
  782. }
  783. });
  784. map.addLayer({
  785. "id": "图书馆@北京",
  786. "type": "symbol",
  787. "source": "vector-tiles",
  788. "source-layer": "图书馆@北京",
  789. "layout": {
  790. "icon-image": "library_11",
  791. "text-offset": [-1, -1],
  792. "text-anchor": "bottom",
  793. "text-field": "{NAME}",
  794. "text-size": 12
  795. },
  796. "paint": {
  797. "text-color": "#666",
  798. "text-opacity": 1,
  799. "text-halo-color": "#ffffff",
  800. "text-halo-width": 1,
  801. "text-halo-blur": 1
  802. }
  803. });
  804. map.addLayer({
  805. "id": "公园@北京",
  806. "type": "symbol",
  807. "source": "vector-tiles",
  808. "source-layer": "公园@北京",
  809. "layout": {
  810. "icon-image": "park_11",
  811. "text-offset": [0, -0.5],
  812. "text-anchor": "bottom",
  813. "text-field": "{NAME}",
  814. "text-size": 12
  815. },
  816. "paint": {
  817. "text-color": "#666",
  818. "text-opacity": 1,
  819. "text-halo-color": "#ffffff",
  820. "text-halo-width": 1,
  821. "text-halo-blur": 1
  822. }
  823. });
  824. map.addLayer({
  825. "id": "综合性广场@北京",
  826. "type": "symbol",
  827. "source": "vector-tiles",
  828. "source-layer": "综合性广场@北京",
  829. "layout": {
  830. "icon-image": "campsite_11",
  831. "text-offset": [0, -0.5],
  832. "text-anchor": "bottom",
  833. "text-field": "{NAME}",
  834. "text-size": 12
  835. },
  836. "paint": {
  837. "text-color": "#666",
  838. "text-opacity": 1,
  839. "text-halo-color": "#ffffff",
  840. "text-halo-width": 1,
  841. "text-halo-blur": 1
  842. }
  843. });
  844. map.addLayer({
  845. "id": "旅游景点@北京",
  846. "type": "symbol",
  847. "source": "vector-tiles",
  848. "source-layer": "旅游景点@北京",
  849. "layout": {
  850. "icon-image": "volcano_11",
  851. "text-offset": [0, -0.5],
  852. "text-anchor": "bottom",
  853. "text-field": "{NAME}",
  854. "text-size": 12
  855. },
  856. "paint": {
  857. "text-color": "#666",
  858. "text-opacity": 1,
  859. "text-halo-color": "#ffffff",
  860. "text-halo-width": 1,
  861. "text-halo-blur": 1
  862. }
  863. });
  864. map.addLayer({
  865. "id": "医疗卫生@北京",
  866. "type": "symbol",
  867. "source": "vector-tiles",
  868. "source-layer": "医疗卫生@北京",
  869. "layout": {
  870. "icon-image": "hospital_11",
  871. "text-offset": [0, -0.5],
  872. "text-anchor": "bottom",
  873. "text-field": "{NAME}",
  874. "text-size": 12
  875. },
  876. "paint": {
  877. "text-color": "#666",
  878. "text-opacity": 1,
  879. "text-halo-color": "#ffffff",
  880. "text-halo-width": 1,
  881. "text-halo-blur": 1
  882. }
  883. });
  884. map.addLayer({
  885. "id": "娱乐场所@北京",
  886. "type": "symbol",
  887. "source": "vector-tiles",
  888. "source-layer": "娱乐场所@北京",
  889. "layout": {
  890. "icon-image": "amusement_park_11",
  891. "text-offset": [0, -0.5],
  892. "text-anchor": "bottom",
  893. "text-field": "{NAME}",
  894. "text-size": 12
  895. },
  896. "paint": {
  897. "text-color": "#666",
  898. "text-opacity": 1,
  899. "text-halo-color": "#ffffff",
  900. "text-halo-width": 1,
  901. "text-halo-blur": 1
  902. }
  903. });
  904. map.addLayer({
  905. "id": "大厦@北京",
  906. "type": "symbol",
  907. "source": "vector-tiles",
  908. "source-layer": "大厦@北京",
  909. "layout": {
  910. "icon-image": "picnic_site_11",
  911. "text-offset": [0, -0.5],
  912. "text-anchor": "bottom",
  913. "text-field": "{NAME}",
  914. "text-size": 12
  915. },
  916. "paint": {
  917. "text-color": "#666",
  918. "text-opacity": 1,
  919. "text-halo-color": "#ffffff",
  920. "text-halo-width": 1,
  921. "text-halo-blur": 1
  922. }
  923. });
  924. map.addLayer({
  925. "id": "文化场所@北京",
  926. "type": "symbol",
  927. "source": "vector-tiles",
  928. "source-layer": "文化场所@北京",
  929. "layout": {
  930. "icon-image": "art_gallery_11",
  931. "text-offset": [0, -0.5],
  932. "text-anchor": "bottom",
  933. "text-field": "{NAME}",
  934. "text-size": 12
  935. },
  936. "paint": {
  937. "text-color": "#666",
  938. "text-opacity": 1,
  939. "text-halo-color": "#ffffff",
  940. "text-halo-width": 1,
  941. "text-halo-blur": 1
  942. }
  943. });
  944. map.addLayer({
  945. "id": "运动场所@北京",
  946. "type": "symbol",
  947. "source": "vector-tiles",
  948. "source-layer": "运动场所@北京",
  949. "layout": {
  950. "icon-image": "bicycle_share_11",
  951. "text-offset": [0, -0.5],
  952. "text-anchor": "bottom",
  953. "text-field": "{NAME}",
  954. "text-size": 12
  955. },
  956. "paint": {
  957. "text-color": "#666",
  958. "text-opacity": 1,
  959. "text-halo-color": "#ffffff",
  960. "text-halo-width": 1,
  961. "text-halo-blur": 1
  962. }
  963. });
  964. map.addLayer({
  965. "id": "交通运输@北京",
  966. "type": "symbol",
  967. "source": "vector-tiles",
  968. "source-layer": "交通运输@北京",
  969. "layout": {
  970. "icon-image": "bakery_11",
  971. "text-offset": [0, -0.5],
  972. "text-anchor": "bottom",
  973. "text-field": "{NAME}",
  974. "text-size": 12
  975. },
  976. "paint": {
  977. "text-color": "#666",
  978. "text-opacity": 1,
  979. "text-halo-color": "#ffffff",
  980. "text-halo-width": 1,
  981. "text-halo-blur": 1
  982. }
  983. });
  984. map.addLayer({
  985. "id": "其它@北京",
  986. "type": "symbol",
  987. "source": "vector-tiles",
  988. "source-layer": "其它@北京",
  989. "layout": {
  990. "icon-image": "toilet_11",
  991. "text-offset": [0, -0.5],
  992. "text-anchor": "bottom",
  993. "text-field": "{NAME}",
  994. "text-size": 12
  995. },
  996. "filter": [
  997. "==",
  998. "NAME",
  999. "公厕"
  1000. ],
  1001. "paint": {
  1002. "text-color": "#666",
  1003. "text-opacity": 1,
  1004. "text-halo-color": "#ffffff",
  1005. "text-halo-width": 1,
  1006. "text-halo-blur": 1
  1007. }
  1008. });
  1009. map.addLayer({
  1010. "id": "服务行业@北京",
  1011. "type": "symbol",
  1012. "source": "vector-tiles",
  1013. "source-layer": "服务行业@北京",
  1014. "layout": {
  1015. "icon-image": "embassy_11",
  1016. "text-offset": [0, -0.5],
  1017. "text-anchor": "bottom",
  1018. "text-field": "{NAME}",
  1019. "text-size": 12
  1020. },
  1021. "paint": {
  1022. "text-color": "#666",
  1023. "text-opacity": 1,
  1024. "text-halo-color": "#ffffff",
  1025. "text-halo-width": 1,
  1026. "text-halo-blur": 1
  1027. }
  1028. });
  1029. map.addLayer({
  1030. "id": "其它@北京2",
  1031. "type": "symbol",
  1032. "source": "vector-tiles",
  1033. "source-layer": "其它@北京",
  1034. "layout": {
  1035. "icon-image": "car_11",
  1036. "text-offset": [0, -0.5],
  1037. "text-anchor": "bottom",
  1038. "text-field": "{NAME}",
  1039. "text-size": 12
  1040. },
  1041. "filter": [
  1042. "==",
  1043. "NAME",
  1044. "停车场"
  1045. ],
  1046. "paint": {
  1047. "text-color": "#666",
  1048. "text-opacity": 1,
  1049. "text-halo-color": "#ffffff",
  1050. "text-halo-width": 1,
  1051. "text-halo-blur": 1
  1052. }
  1053. });
  1054. map.addLayer({
  1055. "id": "邮政电信@北京",
  1056. "type": "symbol",
  1057. "source": "vector-tiles",
  1058. "source-layer": "邮政电信@北京",
  1059. "layout": {
  1060. "icon-image": "post_11",
  1061. "text-offset": [0, -0.5],
  1062. "text-anchor": "bottom",
  1063. "text-field": "{NAME}",
  1064. "text-size": 10,
  1065. "text-max-width": 18
  1066. },
  1067. "paint": {
  1068. "text-color": "#666",
  1069. "text-opacity": 1,
  1070. "text-halo-color": "#ffffff",
  1071. "text-halo-width": 1,
  1072. "text-halo-blur": 1
  1073. }
  1074. });
  1075. map.addLayer({
  1076. "id": "商场@北京",
  1077. "type": "symbol",
  1078. "source": "vector-tiles",
  1079. "source-layer": "商场@北京",
  1080. "layout": {
  1081. "icon-image": "grocery_11",
  1082. "text-offset": [0, -0.5],
  1083. "text-anchor": "bottom",
  1084. "text-field": "{NAME}",
  1085. "text-size": 12
  1086. },
  1087. "paint": {
  1088. "text-color": "#666",
  1089. "text-opacity": 1,
  1090. "text-halo-color": "#ffffff",
  1091. "text-halo-width": 1,
  1092. "text-halo-blur": 1
  1093. }
  1094. });
  1095. map.addLayer({
  1096. "id": "综合性商店@北京",
  1097. "type": "symbol",
  1098. "source": "vector-tiles",
  1099. "source-layer": "综合性商店@北京",
  1100. "layout": {
  1101. "icon-image": "grocery_11",
  1102. "text-offset": [0, -0.5],
  1103. "text-anchor": "bottom",
  1104. "text-field": "{NAME}",
  1105. "text-size": 12
  1106. },
  1107. "paint": {
  1108. "text-color": "#666",
  1109. "text-opacity": 1,
  1110. "text-halo-color": "#ffffff",
  1111. "text-halo-width": 1,
  1112. "text-halo-blur": 1
  1113. }
  1114. });
  1115. map.addLayer({
  1116. "id": "饭店@北京",
  1117. "type": "symbol",
  1118. "source": "vector-tiles",
  1119. "source-layer": "饭店@北京",
  1120. "layout": {
  1121. "icon-image": "restaurant_11",
  1122. "text-offset": [0, -0.5],
  1123. "text-anchor": "bottom",
  1124. "text-field": "{NAME}",
  1125. "text-size": 12
  1126. },
  1127. "paint": {
  1128. "text-color": "#666",
  1129. "text-opacity": 1,
  1130. "text-halo-color": "#ffffff",
  1131. "text-halo-width": 1,
  1132. "text-halo-blur": 1
  1133. }
  1134. });
  1135. map.addLayer({
  1136. "id": "加油站@北京",
  1137. "type": "symbol",
  1138. "source": "vector-tiles",
  1139. "source-layer": "加油站@北京",
  1140. "layout": {
  1141. "icon-image": "fuel_11",
  1142. "text-offset": [0, -0.5],
  1143. "text-anchor": "bottom",
  1144. "text-field": "{NAME}",
  1145. "text-size": 12
  1146. },
  1147. "paint": {
  1148. "text-color": "#666",
  1149. "text-opacity": 1,
  1150. "text-halo-color": "#ffffff",
  1151. "text-halo-width": 1,
  1152. "text-halo-blur": 1
  1153. }
  1154. });
  1155. map.addLayer({
  1156. "id": "建筑@北京",
  1157. "type": "symbol",
  1158. "source": "vector-tiles",
  1159. "source-layer": "建筑@北京",
  1160. "layout": {
  1161. "icon-image": "place_of_worship_11",
  1162. "text-offset": [0, -0.5],
  1163. "text-anchor": "bottom",
  1164. "text-field": "{NAME}",
  1165. "text-size": 12
  1166. },
  1167. "paint": {
  1168. "text-color": "#666",
  1169. "text-opacity": 1,
  1170. "text-halo-color": "#ffffff",
  1171. "text-halo-width": 1,
  1172. "text-halo-blur": 1
  1173. }
  1174. });
  1175. map.addLayer({
  1176. "id": "码头@北京",
  1177. "type": "symbol",
  1178. "source": "vector-tiles",
  1179. "source-layer": "码头@北京",
  1180. "layout": {
  1181. "icon-image": "harbor_11",
  1182. "text-offset": [0, -0.5],
  1183. "text-anchor": "bottom",
  1184. "text-field": "{NAME}",
  1185. "text-size": 12
  1186. },
  1187. "paint": {
  1188. "text-color": "#666",
  1189. "text-opacity": 1,
  1190. "text-halo-color": "#ffffff",
  1191. "text-halo-width": 1,
  1192. "text-halo-blur": 1
  1193. }
  1194. });
  1195. map.addLayer({
  1196. "id": "机场@北京",
  1197. "type": "symbol",
  1198. "source": "vector-tiles",
  1199. "source-layer": "机场@北京",
  1200. "layout": {
  1201. "icon-image": "airport_11",
  1202. "text-offset": [0, -0.5],
  1203. "text-anchor": "bottom",
  1204. "text-field": "{NAME}",
  1205. "text-size": 12
  1206. },
  1207. "paint": {
  1208. "text-color": "#666",
  1209. "text-opacity": 1,
  1210. "text-halo-color": "#ffffff",
  1211. "text-halo-width": 1,
  1212. "text-halo-blur": 1
  1213. }
  1214. });
  1215. map.addLayer({
  1216. "id": "火车站@北京",
  1217. "type": "symbol",
  1218. "source": "vector-tiles",
  1219. "source-layer": "火车站@北京",
  1220. "layout": {
  1221. "icon-image": "rail_15",
  1222. "text-offset": [0, -0.5],
  1223. "text-anchor": "bottom",
  1224. "text-field": "{NAME}",
  1225. "text-size": 12
  1226. },
  1227. "paint": {
  1228. "text-color": "#666",
  1229. "text-opacity": 1,
  1230. "text-halo-color": "#ffffff",
  1231. "text-halo-width": 1,
  1232. "text-halo-blur": 1
  1233. }
  1234. });
  1235. map.addLayer({
  1236. "id": "地名@北京",
  1237. "type": "symbol",
  1238. "source": "vector-tiles",
  1239. "source-layer": "地名@北京",
  1240. "layout": {
  1241. "icon-image": "dot_11",
  1242. "text-offset": [0, -0.3],
  1243. "text-anchor": "bottom",
  1244. "text-field": "{NAME}",
  1245. "text-size": 12
  1246. },
  1247. "paint": {
  1248. "text-color": "#666",
  1249. "text-opacity": 1,
  1250. "text-halo-color": "#ffffff",
  1251. "text-halo-width": 1,
  1252. "text-halo-blur": 1
  1253. }
  1254. });
  1255. });
  1256. </script>
  1257. </body>
  1258. </html>