mvtVectorTile_Beijing_positron.html 38 KB

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