mvtVectorTile_Beijing_klokantech.html 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046
  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_beijingKlokantechStyle"></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": "hsl(47, 26%, 88%)"
  57. }
  58. });
  59. map.addLayer({
  60. "id": "立交桥绿地R@北京",
  61. "type": "fill",
  62. "source": "vector-tiles",
  63. "source-layer": "立交桥绿地R@北京",
  64. "paint": {
  65. "fill-color": "hsl(82, 46%, 72%)",
  66. "fill-opacity": 1
  67. }
  68. });
  69. map.addLayer({
  70. "id": "绿地R@北京",
  71. "type": "fill",
  72. "source": "vector-tiles",
  73. "source-layer": "绿地R@北京",
  74. "paint": {
  75. "fill-color": "hsl(82, 46%, 72%)",
  76. "fill-opacity": 1
  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(205, 56%, 73%)",
  86. }
  87. });
  88. map.addLayer({
  89. "id": "湖泊、水库R@北京",
  90. "type": "fill",
  91. "source": "vector-tiles",
  92. "source-layer": "湖泊、水库R@北京",
  93. "paint": {
  94. "fill-color": "hsl(205, 56%, 73%)",
  95. }
  96. });
  97. map.addLayer({
  98. "id": " 四级道路L@北京",
  99. "type": "line",
  100. "source": "vector-tiles",
  101. "source-layer": "四级道路L@北京",
  102. "layout": {
  103. "line-cap": "round",
  104. "line-join": "round"
  105. },
  106. "paint": {
  107. "line-color": "hsl(0, 0%, 97%)",
  108. "line-width": {
  109. "base": 1.55,
  110. "stops": [
  111. [
  112. 4,
  113. 0.25
  114. ],
  115. [
  116. 20,
  117. 30
  118. ]
  119. ]
  120. }
  121. }
  122. });
  123. map.addLayer({
  124. "id": " 三级道路L@北京",
  125. "type": "line",
  126. "source": "vector-tiles",
  127. "source-layer": "三级道路L@北京",
  128. "layout": {
  129. "line-cap": "round",
  130. "line-join": "round"
  131. },
  132. "paint": {
  133. "line-color": "hsl(0, 0%, 97%)",
  134. "line-width": {
  135. "base": 1.55,
  136. "stops": [
  137. [
  138. 4,
  139. 0.25
  140. ],
  141. [
  142. 20,
  143. 30
  144. ]
  145. ]
  146. }
  147. }
  148. });
  149. map.addLayer({
  150. "id": " 二级道路L@北京",
  151. "type": "line",
  152. "source": "vector-tiles",
  153. "source-layer": "二级道路L@北京",
  154. "layout": {
  155. "line-cap": "round",
  156. "line-join": "round"
  157. },
  158. "paint": {
  159. "line-color": "#fff",
  160. "line-width": {
  161. "base": 1.4,
  162. "stops": [
  163. [
  164. 6,
  165. 0.5
  166. ],
  167. [
  168. 20,
  169. 20
  170. ]
  171. ]
  172. }
  173. }
  174. });
  175. map.addLayer({
  176. "id": "一级道路L@北京",
  177. "type": "line",
  178. "source": "vector-tiles",
  179. "source-layer": "一级道路L@北京",
  180. "layout": {
  181. "line-cap": "round",
  182. "line-join": "round"
  183. },
  184. "paint": {
  185. "line-color": "#fff",
  186. "line-width": {
  187. "base": 1.4,
  188. "stops": [
  189. [
  190. 6,
  191. 0.5
  192. ],
  193. [
  194. 20,
  195. 30
  196. ]
  197. ]
  198. }
  199. }
  200. });
  201. map.addLayer({
  202. "id": " 省道L@北京",
  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": "hsl(0, 0%, 100%)",
  212. "line-width": {
  213. "base": 1.4,
  214. "stops": [
  215. [
  216. 8,
  217. 1
  218. ],
  219. [
  220. 16,
  221. 10
  222. ]
  223. ]
  224. },
  225. "line-offset": 0
  226. }
  227. });
  228. map.addLayer({
  229. "id": " 高速公路L@北京",
  230. "type": "line",
  231. "source": "vector-tiles",
  232. "source-layer": "高速公路L@北京",
  233. "layout": {
  234. "line-cap": "round",
  235. "line-join": "round"
  236. },
  237. "paint": {
  238. "line-color": "hsl(0, 0%, 100%)",
  239. "line-width": {
  240. "base": 1.4,
  241. "stops": [
  242. [
  243. 8,
  244. 1
  245. ],
  246. [
  247. 16,
  248. 10
  249. ]
  250. ]
  251. },
  252. "line-offset": 0
  253. }
  254. });
  255. map.addLayer({
  256. "id": "区政府驻地@北京",
  257. "type": "symbol",
  258. "source": "vector-tiles",
  259. "source-layer": "区政府驻地@北京",
  260. "layout": {
  261. "text-offset": [-1.5, -0.5],
  262. "text-anchor": "bottom-left",
  263. "text-field": "{NAME}",
  264. "text-max-width": 7,
  265. "text-font": [
  266. "DIN Offc Pro Medium",
  267. "Arial Unicode MS Regular"
  268. ],
  269. "text-size": 22
  270. },
  271. "paint": {
  272. "text-color": "hsl(230, 8%, 62%)",
  273. "text-opacity": {
  274. "base": 1,
  275. "stops": [
  276. [
  277. 11.99,
  278. 1
  279. ],
  280. [
  281. 12,
  282. 0
  283. ]
  284. ]
  285. },
  286. "text-halo-color": "rgba(255,255,255,0.75)",
  287. "text-halo-width": 1,
  288. "text-halo-blur": 1
  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(26, 25%, 32%)",
  305. "text-opacity": {
  306. "base": 1,
  307. "stops": [
  308. [
  309. 10.99,
  310. 0
  311. ],
  312. [
  313. 11,
  314. 1
  315. ]
  316. ]
  317. },
  318. "text-halo-color": "rgba(255,255,255,0.75)",
  319. "text-halo-width": 1,
  320. "text-halo-blur": 1
  321. }
  322. });
  323. map.addLayer({
  324. "id": " 四级道路Name",
  325. "type": "symbol",
  326. "source": "vector-tiles",
  327. "source-layer": "四级道路L@北京",
  328. "layout": {
  329. "text-size": {
  330. "base": 1,
  331. "stops": [
  332. [
  333. 13,
  334. 12
  335. ],
  336. [
  337. 14,
  338. 13
  339. ]
  340. ]
  341. },
  342. "text-field": "{道路名称}",
  343. "symbol-placement": "line",
  344. "text-rotation-alignment": "map"
  345. },
  346. "paint": {
  347. "text-halo-blur": 0.5,
  348. "text-color": "#000",
  349. "text-halo-color": "hsl(0, 0%, 100%)",
  350. "text-opacity": {
  351. "base": 1,
  352. "stops": [
  353. [
  354. 14.99,
  355. 0
  356. ],
  357. [
  358. 15,
  359. 1
  360. ]
  361. ]
  362. },
  363. "text-halo-width": 2
  364. }
  365. });
  366. map.addLayer({
  367. "id": " 三级道路Name",
  368. "type": "symbol",
  369. "source": "vector-tiles",
  370. "source-layer": "三级道路L@北京",
  371. "layout": {
  372. "text-size": 10,
  373. "text-max-angle": 30,
  374. "text-transform": "uppercase",
  375. "symbol-spacing": 350,
  376. "symbol-placement": "line",
  377. "visibility": "visible",
  378. "text-rotation-alignment": "map",
  379. "text-pitch-alignment": "viewport",
  380. "text-field": "{道路名称}"
  381. },
  382. "paint": {
  383. "text-color": "#000",
  384. "text-halo-color": "hsl(0, 0%, 100%)",
  385. "text-translate": [
  386. 0,
  387. 0
  388. ],
  389. "text-opacity": {
  390. "base": 1,
  391. "stops": [
  392. [
  393. 13.99,
  394. 0
  395. ],
  396. [
  397. 14,
  398. 1
  399. ]
  400. ]
  401. },
  402. "text-halo-width": 2,
  403. "text-halo-blur": 1
  404. }
  405. });
  406. map.addLayer({
  407. "id": " 二级道路Name",
  408. "type": "symbol",
  409. "source": "vector-tiles",
  410. "source-layer": "二级道路L@北京",
  411. "layout": {
  412. "text-size": 10,
  413. "text-max-angle": 30,
  414. "text-transform": "uppercase",
  415. "symbol-spacing": 350,
  416. "symbol-placement": "line",
  417. "visibility": "visible",
  418. "text-rotation-alignment": "map",
  419. "text-pitch-alignment": "viewport",
  420. "text-field": "{道路名称}"
  421. },
  422. "paint": {
  423. "text-color": "#000",
  424. "text-halo-color": "hsl(0, 0%, 100%)",
  425. "text-translate": [
  426. 0,
  427. 0
  428. ],
  429. "text-opacity": {
  430. "base": 1,
  431. "stops": [
  432. [
  433. 13.99,
  434. 0
  435. ],
  436. [
  437. 14,
  438. 1
  439. ]
  440. ]
  441. },
  442. "text-halo-width": 2,
  443. "text-halo-blur": 1
  444. }
  445. });
  446. map.addLayer({
  447. "id": " 一级道路Name",
  448. "type": "symbol",
  449. "source": "vector-tiles",
  450. "source-layer": "一级道路L@北京",
  451. "layout": {
  452. "text-size": 10,
  453. "text-max-angle": 30,
  454. "text-transform": "uppercase",
  455. "symbol-spacing": 350,
  456. "symbol-placement": "line",
  457. "visibility": "visible",
  458. "text-rotation-alignment": "map",
  459. "text-pitch-alignment": "viewport",
  460. "text-field": "{道路名称}"
  461. },
  462. "paint": {
  463. "text-color": "#000",
  464. "text-halo-color": "hsl(0, 0%, 100%)",
  465. "text-opacity": {
  466. "base": 1,
  467. "stops": [
  468. [
  469. 12.99,
  470. 0
  471. ],
  472. [
  473. 13,
  474. 1
  475. ]
  476. ]
  477. },
  478. "text-halo-width": 2,
  479. "text-halo-blur": 1
  480. }
  481. });
  482. map.addLayer({
  483. "id": " 省道Name",
  484. "type": "symbol",
  485. "source": "vector-tiles",
  486. "source-layer": "省道L@北京",
  487. "layout": {
  488. "text-size": 10,
  489. "text-max-angle": 30,
  490. "text-transform": "uppercase",
  491. "symbol-spacing": 350,
  492. "symbol-placement": "line",
  493. "visibility": "visible",
  494. "text-rotation-alignment": "map",
  495. "text-pitch-alignment": "viewport",
  496. "text-field": "{道路名称}"
  497. },
  498. "paint": {
  499. "text-color": "#000",
  500. "text-halo-color": "hsl(0, 0%, 100%)",
  501. "text-opacity": {
  502. "base": 1,
  503. "stops": [
  504. [
  505. 12.99,
  506. 0
  507. ],
  508. [
  509. 13,
  510. 1
  511. ]
  512. ]
  513. },
  514. "text-halo-width": 2,
  515. "text-halo-blur": 1
  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": "#666",
  531. "text-opacity": 1,
  532. "text-halo-color": "rgba(255,255,255,0.75)",
  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. "text-offset": [-1, -1],
  544. "text-anchor": "bottom",
  545. "text-field": "{NAME}",
  546. "text-size": 12
  547. },
  548. "paint": {
  549. "text-color": "#666",
  550. "text-opacity": 1,
  551. "text-halo-color": "rgba(255,255,255,0.75)",
  552. "text-halo-width": 1,
  553. "text-halo-blur": 1
  554. }
  555. });
  556. map.addLayer({
  557. "id": "图书馆@北京",
  558. "type": "symbol",
  559. "source": "vector-tiles",
  560. "source-layer": "图书馆@北京",
  561. "layout": {
  562. "text-offset": [-1, -1],
  563. "text-anchor": "bottom",
  564. "text-field": "{NAME}",
  565. "text-size": 12
  566. },
  567. "paint": {
  568. "text-color": "#666",
  569. "text-opacity": 1,
  570. "text-halo-color": "rgba(255,255,255,0.75)",
  571. "text-halo-width": 1,
  572. "text-halo-blur": 1
  573. }
  574. });
  575. map.addLayer({
  576. "id": "公园@北京",
  577. "type": "symbol",
  578. "source": "vector-tiles",
  579. "source-layer": "公园@北京",
  580. "layout": {
  581. "text-offset": [0, -0.5],
  582. "text-anchor": "bottom",
  583. "text-field": "{NAME}",
  584. "text-size": 12
  585. },
  586. "paint": {
  587. "text-color": "#666",
  588. "text-opacity": 1,
  589. "text-halo-color": "rgba(255,255,255,0.75)",
  590. "text-halo-width": 1,
  591. "text-halo-blur": 1
  592. }
  593. });
  594. map.addLayer({
  595. "id": "综合性广场@北京",
  596. "type": "symbol",
  597. "source": "vector-tiles",
  598. "source-layer": "综合性广场@北京",
  599. "layout": {
  600. "text-offset": [0, -0.5],
  601. "text-anchor": "bottom",
  602. "text-field": "{NAME}",
  603. "text-size": 12
  604. },
  605. "paint": {
  606. "text-color": "#666",
  607. "text-opacity": 1,
  608. "text-halo-color": "rgba(255,255,255,0.75)",
  609. "text-halo-width": 1,
  610. "text-halo-blur": 1
  611. }
  612. });
  613. map.addLayer({
  614. "id": "旅游景点@北京",
  615. "type": "symbol",
  616. "source": "vector-tiles",
  617. "source-layer": "旅游景点@北京",
  618. "layout": {
  619. "text-offset": [0, -0.5],
  620. "text-anchor": "bottom",
  621. "text-field": "{NAME}",
  622. "text-size": 12
  623. },
  624. "paint": {
  625. "text-color": "#666",
  626. "text-opacity": 1,
  627. "text-halo-color": "rgba(255,255,255,0.75)",
  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. "text-offset": [0, -0.5],
  639. "text-anchor": "bottom",
  640. "text-field": "{NAME}",
  641. "text-size": 12
  642. },
  643. "paint": {
  644. "text-color": "#666",
  645. "text-opacity": 1,
  646. "text-halo-color": "rgba(255,255,255,0.75)",
  647. "text-halo-width": 1,
  648. "text-halo-blur": 1
  649. }
  650. });
  651. map.addLayer({
  652. "id": "娱乐场所@北京",
  653. "type": "symbol",
  654. "source": "vector-tiles",
  655. "source-layer": "娱乐场所@北京",
  656. "layout": {
  657. "text-offset": [0, -0.5],
  658. "text-anchor": "bottom",
  659. "text-field": "{NAME}",
  660. "text-size": 12
  661. },
  662. "paint": {
  663. "text-color": "#666",
  664. "text-opacity": 1,
  665. "text-halo-color": "rgba(255,255,255,0.75)",
  666. "text-halo-width": 1,
  667. "text-halo-blur": 1
  668. }
  669. });
  670. map.addLayer({
  671. "id": "大厦@北京",
  672. "type": "symbol",
  673. "source": "vector-tiles",
  674. "source-layer": "大厦@北京",
  675. "layout": {
  676. "text-offset": [0, -0.5],
  677. "text-anchor": "bottom",
  678. "text-field": "{NAME}",
  679. "text-size": 12
  680. },
  681. "paint": {
  682. "text-color": "#666",
  683. "text-opacity": 1,
  684. "text-halo-color": "rgba(255,255,255,0.75)",
  685. "text-halo-width": 1,
  686. "text-halo-blur": 1
  687. }
  688. });
  689. map.addLayer({
  690. "id": "文化场所@北京",
  691. "type": "symbol",
  692. "source": "vector-tiles",
  693. "source-layer": "文化场所@北京",
  694. "layout": {
  695. "text-offset": [0, -0.5],
  696. "text-anchor": "bottom",
  697. "text-field": "{NAME}",
  698. "text-size": 12
  699. },
  700. "paint": {
  701. "text-color": "#666",
  702. "text-opacity": 1,
  703. "text-halo-color": "rgba(255,255,255,0.75)",
  704. "text-halo-width": 1,
  705. "text-halo-blur": 1
  706. }
  707. });
  708. map.addLayer({
  709. "id": "运动场所@北京",
  710. "type": "symbol",
  711. "source": "vector-tiles",
  712. "source-layer": "运动场所@北京",
  713. "layout": {
  714. "text-offset": [0, -0.5],
  715. "text-anchor": "bottom",
  716. "text-field": "{NAME}",
  717. "text-size": 12
  718. },
  719. "paint": {
  720. "text-color": "#666",
  721. "text-opacity": 1,
  722. "text-halo-color": "rgba(255,255,255,0.75)",
  723. "text-halo-width": 1,
  724. "text-halo-blur": 1
  725. }
  726. });
  727. map.addLayer({
  728. "id": "交通运输@北京",
  729. "type": "symbol",
  730. "source": "vector-tiles",
  731. "source-layer": "交通运输@北京",
  732. "layout": {
  733. "text-offset": [0, -0.5],
  734. "text-anchor": "bottom",
  735. "text-field": "{NAME}",
  736. "text-size": 12
  737. },
  738. "paint": {
  739. "text-color": "#666",
  740. "text-opacity": 1,
  741. "text-halo-color": "rgba(255,255,255,0.75)",
  742. "text-halo-width": 1,
  743. "text-halo-blur": 1
  744. }
  745. });
  746. map.addLayer({
  747. "id": "其它@北京",
  748. "type": "symbol",
  749. "source": "vector-tiles",
  750. "source-layer": "其它@北京",
  751. "layout": {
  752. "text-offset": [0, -0.5],
  753. "text-anchor": "bottom",
  754. "text-field": "{NAME}",
  755. "text-size": 12
  756. },
  757. "filter": [
  758. "==",
  759. "NAME",
  760. "公厕"
  761. ],
  762. "paint": {
  763. "text-color": "#666",
  764. "text-opacity": 1,
  765. "text-halo-color": "rgba(255,255,255,0.75)",
  766. "text-halo-width": 1,
  767. "text-halo-blur": 1
  768. }
  769. });
  770. map.addLayer({
  771. "id": "服务行业@北京",
  772. "type": "symbol",
  773. "source": "vector-tiles",
  774. "source-layer": "服务行业@北京",
  775. "layout": {
  776. "text-offset": [0, -0.5],
  777. "text-anchor": "bottom",
  778. "text-field": "{NAME}",
  779. "text-size": 12
  780. },
  781. "paint": {
  782. "text-color": "#666",
  783. "text-opacity": 1,
  784. "text-halo-color": "rgba(255,255,255,0.75)",
  785. "text-halo-width": 1,
  786. "text-halo-blur": 1
  787. }
  788. });
  789. map.addLayer({
  790. "id": "其它@北京2",
  791. "type": "symbol",
  792. "source": "vector-tiles",
  793. "source-layer": "其它@北京",
  794. "layout": {
  795. "text-offset": [0, -0.5],
  796. "text-anchor": "bottom",
  797. "text-field": "{NAME}",
  798. "text-size": 12
  799. },
  800. "filter": [
  801. "==",
  802. "NAME",
  803. "停车场"
  804. ],
  805. "paint": {
  806. "text-color": "#666",
  807. "text-opacity": 1,
  808. "text-halo-color": "rgba(255,255,255,0.75)",
  809. "text-halo-width": 1,
  810. "text-halo-blur": 1
  811. }
  812. });
  813. map.addLayer({
  814. "id": "邮政电信@北京",
  815. "type": "symbol",
  816. "source": "vector-tiles",
  817. "source-layer": "邮政电信@北京",
  818. "layout": {
  819. "text-offset": [0, -0.5],
  820. "text-anchor": "bottom",
  821. "text-field": "{NAME}",
  822. "text-size": 10,
  823. "text-max-width": 18
  824. },
  825. "paint": {
  826. "text-color": "#666",
  827. "text-opacity": 1,
  828. "text-halo-color": "rgba(255,255,255,0.75)",
  829. "text-halo-width": 1,
  830. "text-halo-blur": 1
  831. }
  832. });
  833. map.addLayer({
  834. "id": "商场@北京",
  835. "type": "symbol",
  836. "source": "vector-tiles",
  837. "source-layer": "商场@北京",
  838. "layout": {
  839. "text-offset": [0, -0.5],
  840. "text-anchor": "bottom",
  841. "text-field": "{NAME}",
  842. "text-size": 12
  843. },
  844. "paint": {
  845. "text-color": "#666",
  846. "text-opacity": 1,
  847. "text-halo-color": "rgba(255,255,255,0.75)",
  848. "text-halo-width": 1,
  849. "text-halo-blur": 1
  850. }
  851. });
  852. map.addLayer({
  853. "id": "综合性商店@北京",
  854. "type": "symbol",
  855. "source": "vector-tiles",
  856. "source-layer": "综合性商店@北京",
  857. "layout": {
  858. "text-offset": [0, -0.5],
  859. "text-anchor": "bottom",
  860. "text-field": "{NAME}",
  861. "text-size": 12
  862. },
  863. "paint": {
  864. "text-color": "#666",
  865. "text-opacity": 1,
  866. "text-halo-color": "rgba(255,255,255,0.75)",
  867. "text-halo-width": 1,
  868. "text-halo-blur": 1
  869. }
  870. });
  871. map.addLayer({
  872. "id": "饭店@北京",
  873. "type": "symbol",
  874. "source": "vector-tiles",
  875. "source-layer": "饭店@北京",
  876. "layout": {
  877. "text-offset": [0, -0.5],
  878. "text-anchor": "bottom",
  879. "text-field": "{NAME}",
  880. "text-size": 12
  881. },
  882. "paint": {
  883. "text-color": "#666",
  884. "text-opacity": 1,
  885. "text-halo-color": "rgba(255,255,255,0.75)",
  886. "text-halo-width": 1,
  887. "text-halo-blur": 1
  888. }
  889. });
  890. map.addLayer({
  891. "id": "加油站@北京",
  892. "type": "symbol",
  893. "source": "vector-tiles",
  894. "source-layer": "加油站@北京",
  895. "layout": {
  896. "text-offset": [0, -0.5],
  897. "text-anchor": "bottom",
  898. "text-field": "{NAME}",
  899. "text-size": 12
  900. },
  901. "paint": {
  902. "text-color": "#666",
  903. "text-opacity": 1,
  904. "text-halo-color": "rgba(255,255,255,0.75)",
  905. "text-halo-width": 1,
  906. "text-halo-blur": 1
  907. }
  908. });
  909. map.addLayer({
  910. "id": "建筑@北京",
  911. "type": "symbol",
  912. "source": "vector-tiles",
  913. "source-layer": "建筑@北京",
  914. "layout": {
  915. "text-offset": [0, -0.5],
  916. "text-anchor": "bottom",
  917. "text-field": "{NAME}",
  918. "text-size": 12
  919. },
  920. "paint": {
  921. "text-color": "#666",
  922. "text-opacity": 1,
  923. "text-halo-color": "rgba(255,255,255,0.75)",
  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. "text-offset": [0, -0.5],
  935. "text-anchor": "bottom",
  936. "text-field": "{NAME}",
  937. "text-size": 12
  938. },
  939. "paint": {
  940. "text-color": "#666",
  941. "text-opacity": 1,
  942. "text-halo-color": "rgba(255,255,255,0.75)",
  943. "text-halo-width": 1,
  944. "text-halo-blur": 1
  945. }
  946. });
  947. map.addLayer({
  948. "id": "机场@北京",
  949. "type": "symbol",
  950. "source": "vector-tiles",
  951. "source-layer": "机场@北京",
  952. "layout": {
  953. "text-offset": [0, -0.5],
  954. "text-anchor": "bottom",
  955. "text-field": "{NAME}",
  956. "text-size": 12
  957. },
  958. "paint": {
  959. "text-color": "#666",
  960. "text-opacity": 1,
  961. "text-halo-color": "rgba(255,255,255,0.75)",
  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": "#666",
  979. "text-opacity": 1,
  980. "text-halo-color": "rgba(255,255,255,0.75)",
  981. "text-halo-width": 1,
  982. "text-halo-blur": 1
  983. }
  984. });
  985. map.addLayer({
  986. "id": "地名@北京",
  987. "type": "symbol",
  988. "source": "vector-tiles",
  989. "source-layer": "地名@北京",
  990. "layout": {
  991. "text-offset": [0, -0.3],
  992. "text-anchor": "bottom",
  993. "text-field": "{NAME}",
  994. "text-size": 12
  995. },
  996. "paint": {
  997. "text-color": "#666",
  998. "text-opacity": 1,
  999. "text-halo-color": "rgba(255,255,255,0.75)",
  1000. "text-halo-width": 1,
  1001. "text-halo-blur": 1
  1002. }
  1003. });
  1004. });
  1005. </script>
  1006. </body>
  1007. </html>