mvtVectorTile.html 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515
  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_chinaMVTVectorTile"></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-china400/rest/maps/China/tileFeature.mvt?_cache=false&returnAttributes=true&width=512&height=512&viewBounds={bbox-epsg-3857}"]
  40. },
  41. },
  42. "glyphs": host + "/iserver/services/map-china400/rest/maps/China/tileFeature/sdffonts/{fontstack}/{range}.pbf",
  43. "layers": []
  44. },
  45. center: [120.143, 30.236], // starting position
  46. zoom: 0 // starting zoom
  47. });
  48. map.addControl(new mapboxgl.NavigationControl(), 'top-left');
  49. map.on('load', function () {
  50. map.addLayer({
  51. "id": "background",
  52. "type": "background",
  53. "layout": {},
  54. "paint": {
  55. "background-color": "#75CFF0"
  56. }
  57. });
  58. map.addLayer({
  59. "id": "World_Continent_pl",
  60. "type": "fill",
  61. "source": "vector-tiles",
  62. "source-layer": "World_Continent_pg@China",
  63. "paint": {
  64. "fill-color": "#E6EBC9",
  65. }
  66. });
  67. map.addLayer({
  68. "id": "China_Boundary",
  69. "type": "line",
  70. "source": "vector-tiles",
  71. "source-layer": "China_Boundary_A_ln@China",
  72. "paint": {
  73. "line-color": "hsl(230, 8%, 51%)",
  74. "line-width": {
  75. "base": 1,
  76. "stops": [
  77. [
  78. 3,
  79. 0.5
  80. ],
  81. [
  82. 10,
  83. 2
  84. ]
  85. ]
  86. }
  87. }
  88. });
  89. map.addLayer({
  90. "id": "China_Boundary_ln",
  91. "type": "line",
  92. "source": "vector-tiles",
  93. "source-layer": "China_Boundary_A_ln@China",
  94. "paint": {
  95. "line-color": "hsl(230, 8%, 51%)",
  96. "line-width": {
  97. "base": 1,
  98. "stops": [
  99. [
  100. 3,
  101. 0.5
  102. ],
  103. [
  104. 10,
  105. 2
  106. ]
  107. ]
  108. }
  109. }
  110. });
  111. map.addLayer({
  112. "id": "China_Province_ln1",
  113. "type": "line",
  114. "source": "vector-tiles",
  115. "source-layer": "China_Province_ln@China",
  116. "paint": {
  117. "line-color": "hsl(255, 14%, 77%)"
  118. }
  119. });
  120. map.addLayer({
  121. "id": "Main_River",
  122. "type": "line",
  123. "source": "vector-tiles",
  124. "source-layer": "Main_River_ln@China",
  125. "paint": {
  126. "line-color": "hsl(196, 80%, 70%)"
  127. }
  128. });
  129. map.addLayer({
  130. "id": " Main_Road_L",
  131. "type": "line",
  132. "source": "vector-tiles",
  133. "source-layer": "Main_Road_L@China",
  134. "paint": {
  135. "line-width": {
  136. "base": 1.5,
  137. "stops": [
  138. [
  139. 5,
  140. 0.75
  141. ],
  142. [
  143. 18,
  144. 32
  145. ]
  146. ]
  147. },
  148. "line-color": {
  149. "base": 1,
  150. "stops": [
  151. [
  152. 8,
  153. "hsl(26, 87%, 62%)"
  154. ],
  155. [
  156. 9,
  157. "hsl(26, 100%, 68%)"
  158. ]
  159. ]
  160. }
  161. }
  162. });
  163. map.addLayer({
  164. "id": "Arterial_Road_ln",
  165. "type": "line",
  166. "source": "vector-tiles",
  167. "source-layer": "Arterial_Road_ln@China",
  168. "paint": {
  169. "line-width": {
  170. "base": 1.5,
  171. "stops": [
  172. [
  173. 5,
  174. 0.75
  175. ],
  176. [
  177. 18,
  178. 32
  179. ]
  180. ]
  181. },
  182. "line-color": {
  183. "base": 1,
  184. "stops": [
  185. [
  186. 8,
  187. "hsl(26, 87%, 62%)"
  188. ],
  189. [
  190. 9,
  191. "hsl(26, 100%, 68%)"
  192. ]
  193. ]
  194. }
  195. }
  196. });
  197. map.addLayer({
  198. "id": "Provincial_Road_ln1",
  199. "type": "line",
  200. "source": "vector-tiles",
  201. "source-layer": "Provincial_Road_ln@China",
  202. "paint": {
  203. "line-width": {
  204. "base": 1.5,
  205. "stops": [
  206. [
  207. 5,
  208. 0.75
  209. ],
  210. [
  211. 18,
  212. 32
  213. ]
  214. ]
  215. },
  216. "line-color": {
  217. "base": 1,
  218. "stops": [
  219. [
  220. 8,
  221. "hsl(26, 87%, 62%)"
  222. ],
  223. [
  224. 9,
  225. "hsl(26, 100%, 68%)"
  226. ]
  227. ]
  228. }
  229. }
  230. });
  231. map.addLayer({
  232. "id": " Main_Road_L1",
  233. "type": "line",
  234. "source": "vector-tiles",
  235. "source-layer": "Main_Road_L@China",
  236. "paint": {
  237. "line-width": {
  238. "base": 1.5,
  239. "stops": [
  240. [
  241. 5,
  242. 0.75
  243. ],
  244. [
  245. 18,
  246. 32
  247. ]
  248. ]
  249. },
  250. "line-color": {
  251. "base": 1,
  252. "stops": [
  253. [
  254. 8,
  255. "hsl(26, 87%, 62%)"
  256. ],
  257. [
  258. 9,
  259. "hsl(26, 100%, 68%)"
  260. ]
  261. ]
  262. }
  263. }
  264. });
  265. map.addLayer({
  266. "id": "Arterial_Road_ln1",
  267. "type": "line",
  268. "source": "vector-tiles",
  269. "source-layer": "Arterial_Road_ln@China",
  270. "paint": {
  271. "line-width": {
  272. "base": 1.5,
  273. "stops": [
  274. [
  275. 5,
  276. 0.75
  277. ],
  278. [
  279. 18,
  280. 32
  281. ]
  282. ]
  283. },
  284. "line-color": {
  285. "base": 1,
  286. "stops": [
  287. [
  288. 8,
  289. "hsl(26, 87%, 62%)"
  290. ],
  291. [
  292. 9,
  293. "hsl(26, 100%, 68%)"
  294. ]
  295. ]
  296. }
  297. }
  298. });
  299. map.addLayer({
  300. "id": " Main_Road_L11",
  301. "type": "line",
  302. "source": "vector-tiles",
  303. "source-layer": "Main_Road_L@China",
  304. "paint": {
  305. "line-width": {
  306. "base": 1.5,
  307. "stops": [
  308. [
  309. 5,
  310. 0.75
  311. ],
  312. [
  313. 18,
  314. 32
  315. ]
  316. ]
  317. },
  318. "line-color": {
  319. "base": 1,
  320. "stops": [
  321. [
  322. 8,
  323. "hsl(26, 87%, 62%)"
  324. ],
  325. [
  326. 9,
  327. "hsl(26, 100%, 68%)"
  328. ]
  329. ]
  330. }
  331. }
  332. });
  333. map.addLayer({
  334. "id": "Arterial_Road_ln11",
  335. "type": "line",
  336. "source": "vector-tiles",
  337. "source-layer": "Arterial_Road_ln@China",
  338. "paint": {
  339. "line-width": {
  340. "base": 1.5,
  341. "stops": [
  342. [
  343. 5,
  344. 0.75
  345. ],
  346. [
  347. 18,
  348. 32
  349. ]
  350. ]
  351. },
  352. "line-color": {
  353. "base": 1,
  354. "stops": [
  355. [
  356. 8,
  357. "hsl(26, 87%, 62%)"
  358. ],
  359. [
  360. 9,
  361. "hsl(26, 100%, 68%)"
  362. ]
  363. ]
  364. }
  365. }
  366. });
  367. map.addLayer({
  368. "id": "Provincial_Road_ln",
  369. "type": "line",
  370. "source": "vector-tiles",
  371. "source-layer": "Provincial_Road_ln@China",
  372. "paint": {
  373. "line-width": {
  374. "base": 1.5,
  375. "stops": [
  376. [
  377. 5,
  378. 0.75
  379. ],
  380. [
  381. 18,
  382. 32
  383. ]
  384. ]
  385. },
  386. "line-color": {
  387. "base": 1,
  388. "stops": [
  389. [
  390. 8,
  391. "hsl(26, 87%, 62%)"
  392. ],
  393. [
  394. 9,
  395. "hsl(26, 100%, 68%)"
  396. ]
  397. ]
  398. }
  399. }
  400. });
  401. map.addLayer({
  402. "id": "Provincial_Road_ln2",
  403. "type": "line",
  404. "source": "vector-tiles",
  405. "source-layer": "Provincial_Road_ln@China",
  406. "paint": {
  407. "line-width": {
  408. "base": 1.5,
  409. "stops": [
  410. [
  411. 5,
  412. 0.75
  413. ],
  414. [
  415. 18,
  416. 32
  417. ]
  418. ]
  419. },
  420. "line-color": {
  421. "base": 1,
  422. "stops": [
  423. [
  424. 8,
  425. "hsl(26, 87%, 62%)"
  426. ],
  427. [
  428. 9,
  429. "hsl(26, 100%, 68%)"
  430. ]
  431. ]
  432. }
  433. }
  434. });
  435. map.addLayer({
  436. "id": "County_Road_ln",
  437. "type": "line",
  438. "source": "vector-tiles",
  439. "source-layer": "County_Road_ln@China",
  440. "paint": {
  441. "line-width": {
  442. "base": 1.5,
  443. "stops": [
  444. [
  445. 5,
  446. 0.75
  447. ],
  448. [
  449. 18,
  450. 32
  451. ]
  452. ]
  453. },
  454. "line-color": {
  455. "base": 1,
  456. "stops": [
  457. [
  458. 8,
  459. "hsl(26, 87%, 62%)"
  460. ],
  461. [
  462. 9,
  463. "hsl(26, 100%, 68%)"
  464. ]
  465. ]
  466. }
  467. }
  468. });
  469. map.addLayer({
  470. "id": "China_provincename_B_txt",
  471. "type": "symbol",
  472. "source": "vector-tiles",
  473. "source-layer": "China_provincename_B_txt@China",
  474. "layout": {
  475. "text-font": {
  476. "base": 1,
  477. "stops": [
  478. [
  479. 7,
  480. [
  481. "DIN Offc Pro Regular",
  482. "Arial Unicode MS Regular"
  483. ]
  484. ],
  485. [
  486. 8,
  487. [
  488. "DIN Offc Pro Medium",
  489. "Arial Unicode MS Regular"
  490. ]
  491. ]
  492. ]
  493. },
  494. "text-offset": {
  495. "base": 1,
  496. "stops": [
  497. [
  498. 7.99,
  499. [
  500. 0,
  501. -0.4
  502. ]
  503. ],
  504. [
  505. 8,
  506. [
  507. 0,
  508. 0
  509. ]
  510. ]
  511. ]
  512. },
  513. "text-anchor": {
  514. "base": 1,
  515. "stops": [
  516. [
  517. 7,
  518. "bottom"
  519. ],
  520. [
  521. 8,
  522. "center"
  523. ]
  524. ]
  525. },
  526. "text-field": "{TEXT_FEATURE_CONTENT}",
  527. "text-max-width": 7,
  528. "text-size": {
  529. "base": 0.9,
  530. "stops": [
  531. [
  532. 4,
  533. 12
  534. ],
  535. [
  536. 10,
  537. 22
  538. ]
  539. ]
  540. }
  541. },
  542. "paint": {
  543. "text-color": "hsl(0, 0%, 0%)",
  544. "text-opacity": 1,
  545. "text-halo-color": "hsl(0, 0%, 100%)",
  546. "text-halo-width": 1,
  547. "text-halo-blur": 1
  548. }
  549. });
  550. map.addLayer({
  551. "id": "China_Rural_pt",
  552. "type": "symbol",
  553. "source": "vector-tiles",
  554. "source-layer": "China_Rural_pt@China",
  555. "layout": {
  556. "text-font": {
  557. "base": 1,
  558. "stops": [
  559. [
  560. 7,
  561. [
  562. "DIN Offc Pro Regular",
  563. "Arial Unicode MS Regular"
  564. ]
  565. ],
  566. [
  567. 8,
  568. [
  569. "DIN Offc Pro Medium",
  570. "Arial Unicode MS Regular"
  571. ]
  572. ]
  573. ]
  574. },
  575. "text-offset": {
  576. "base": 1,
  577. "stops": [
  578. [
  579. 7.99,
  580. [
  581. 0,
  582. -0.4
  583. ]
  584. ],
  585. [
  586. 8,
  587. [
  588. 0,
  589. 0
  590. ]
  591. ]
  592. ]
  593. },
  594. "text-anchor": {
  595. "base": 1,
  596. "stops": [
  597. [
  598. 7,
  599. "bottom"
  600. ],
  601. [
  602. 8,
  603. "center"
  604. ]
  605. ]
  606. },
  607. "text-field": "{TEXT_FEATURE_CONTENT}",
  608. "text-max-width": 7,
  609. "text-size": {
  610. "base": 0.9,
  611. "stops": [
  612. [
  613. 4,
  614. 12
  615. ],
  616. [
  617. 10,
  618. 22
  619. ]
  620. ]
  621. }
  622. },
  623. "paint": {
  624. "text-color": "hsl(0, 0%, 0%)",
  625. "text-opacity": 1,
  626. "text-halo-color": "hsl(0, 0%, 100%)",
  627. "text-halo-width": 1,
  628. "text-halo-blur": 1
  629. }
  630. });
  631. map.addLayer({
  632. "id": "China_Rural_pt2",
  633. "type": "symbol",
  634. "source": "vector-tiles",
  635. "source-layer": "China_Rural_pt@China",
  636. "layout": {
  637. "text-font": {
  638. "base": 1,
  639. "stops": [
  640. [
  641. 7,
  642. [
  643. "DIN Offc Pro Regular",
  644. "Arial Unicode MS Regular"
  645. ]
  646. ],
  647. [
  648. 8,
  649. [
  650. "DIN Offc Pro Medium",
  651. "Arial Unicode MS Regular"
  652. ]
  653. ]
  654. ]
  655. },
  656. "text-offset": {
  657. "base": 1,
  658. "stops": [
  659. [
  660. 7.99,
  661. [
  662. 0,
  663. -0.4
  664. ]
  665. ],
  666. [
  667. 8,
  668. [
  669. 0,
  670. 0
  671. ]
  672. ]
  673. ]
  674. },
  675. "text-anchor": {
  676. "base": 1,
  677. "stops": [
  678. [
  679. 7,
  680. "bottom"
  681. ],
  682. [
  683. 8,
  684. "center"
  685. ]
  686. ]
  687. },
  688. "text-field": "{TEXT_FEATURE_CONTENT}",
  689. "text-max-width": 7,
  690. "text-size": {
  691. "base": 0.9,
  692. "stops": [
  693. [
  694. 4,
  695. 12
  696. ],
  697. [
  698. 10,
  699. 22
  700. ]
  701. ]
  702. }
  703. },
  704. "paint": {
  705. "text-color": "hsl(0, 0%, 0%)",
  706. "text-opacity": 1,
  707. "text-halo-color": "hsl(0, 0%, 100%)",
  708. "text-halo-width": 1,
  709. "text-halo-blur": 1
  710. }
  711. });
  712. map.addLayer({
  713. "id": "China_Capital",
  714. "type": "symbol",
  715. "source": "vector-tiles",
  716. "source-layer": "China_Capital_pt@China",
  717. "layout": {
  718. "icon-image": "star-11",
  719. "text-font": {
  720. "base": 1,
  721. "stops": [
  722. [
  723. 7,
  724. [
  725. "DIN Offc Pro Regular",
  726. "Arial Unicode MS Regular"
  727. ]
  728. ],
  729. [
  730. 8,
  731. [
  732. "DIN Offc Pro Medium",
  733. "Arial Unicode MS Regular"
  734. ]
  735. ]
  736. ]
  737. },
  738. "text-offset": {
  739. "base": 1,
  740. "stops": [
  741. [
  742. 7.99,
  743. [
  744. 0,
  745. -0.4
  746. ]
  747. ],
  748. [
  749. 8,
  750. [
  751. 0,
  752. 0
  753. ]
  754. ]
  755. ]
  756. },
  757. "text-anchor": {
  758. "base": 1,
  759. "stops": [
  760. [
  761. 7,
  762. "bottom"
  763. ],
  764. [
  765. 8,
  766. "center"
  767. ]
  768. ]
  769. },
  770. "text-field": "{NAME}",
  771. "text-max-width": 7,
  772. "text-size": {
  773. "base": 0.9,
  774. "stops": [
  775. [
  776. 4,
  777. 12
  778. ],
  779. [
  780. 10,
  781. 22
  782. ]
  783. ]
  784. }
  785. },
  786. "paint": {
  787. "text-color": "hsl(0, 0%, 0%)",
  788. "text-opacity": 1,
  789. "text-halo-color": "hsl(0, 0%, 100%)",
  790. "text-halo-width": 1,
  791. "icon-color": "#ff0000",
  792. "icon-opacity": {
  793. "base": 1,
  794. "stops": [
  795. [
  796. 7.99,
  797. 1
  798. ],
  799. [
  800. 8,
  801. 0
  802. ]
  803. ]
  804. },
  805. "text-halo-blur": 1
  806. }
  807. });
  808. map.addLayer({
  809. "id": "China_PreCenCity_pt_A",
  810. "type": "symbol",
  811. "source": "vector-tiles",
  812. "source-layer": "China_preCenCity_C_pt@China",
  813. "layout": {
  814. "icon-image": "dot-11",
  815. "text-font": {
  816. "base": 1,
  817. "stops": [
  818. [
  819. 7,
  820. [
  821. "DIN Offc Pro Regular",
  822. "Arial Unicode MS Regular"
  823. ]
  824. ],
  825. [
  826. 8,
  827. [
  828. "DIN Offc Pro Medium",
  829. "Arial Unicode MS Regular"
  830. ]
  831. ]
  832. ]
  833. },
  834. "text-offset": {
  835. "base": 1,
  836. "stops": [
  837. [
  838. 7.99,
  839. [
  840. 0,
  841. -0.25
  842. ]
  843. ],
  844. [
  845. 8,
  846. [
  847. 0,
  848. 0
  849. ]
  850. ]
  851. ]
  852. },
  853. "text-anchor": {
  854. "base": 1,
  855. "stops": [
  856. [
  857. 7,
  858. "bottom"
  859. ],
  860. [
  861. 8,
  862. "center"
  863. ]
  864. ]
  865. },
  866. "text-field": "{NAME}",
  867. "text-max-width": 7,
  868. "text-size": {
  869. "base": 0.9,
  870. "stops": [
  871. [
  872. 4,
  873. 12
  874. ],
  875. [
  876. 10,
  877. 22
  878. ]
  879. ]
  880. }
  881. },
  882. "paint": {
  883. "text-color": "hsl(0, 0%, 0%)",
  884. "text-opacity": 1,
  885. "text-halo-color": "hsl(0, 0%, 100%)",
  886. "text-halo-width": 1,
  887. "icon-opacity": {
  888. "base": 1,
  889. "stops": [
  890. [
  891. 7.99,
  892. 1
  893. ],
  894. [
  895. 8,
  896. 0
  897. ]
  898. ]
  899. },
  900. "text-halo-blur": 1
  901. }
  902. });
  903. map.addLayer({
  904. "id": "China_PreCenCity_pt",
  905. "type": "symbol",
  906. "source": "vector-tiles",
  907. "source-layer": "China_PreCenCity_A_pt@China",
  908. "layout": {
  909. "icon-image": "dot-11",
  910. "text-font": {
  911. "base": 1,
  912. "stops": [
  913. [
  914. 7,
  915. [
  916. "DIN Offc Pro Regular",
  917. "Arial Unicode MS Regular"
  918. ]
  919. ],
  920. [
  921. 8,
  922. [
  923. "DIN Offc Pro Medium",
  924. "Arial Unicode MS Regular"
  925. ]
  926. ]
  927. ]
  928. },
  929. "text-offset": {
  930. "base": 1,
  931. "stops": [
  932. [
  933. 7.99,
  934. [
  935. 0,
  936. -0.25
  937. ]
  938. ],
  939. [
  940. 8,
  941. [
  942. 0,
  943. 0
  944. ]
  945. ]
  946. ]
  947. },
  948. "text-anchor": {
  949. "base": 1,
  950. "stops": [
  951. [
  952. 7,
  953. "bottom"
  954. ],
  955. [
  956. 8,
  957. "center"
  958. ]
  959. ]
  960. },
  961. "text-field": "{NAME}",
  962. "text-max-width": 7,
  963. "text-size": {
  964. "base": 0.9,
  965. "stops": [
  966. [
  967. 4,
  968. 12
  969. ],
  970. [
  971. 10,
  972. 22
  973. ]
  974. ]
  975. }
  976. },
  977. "paint": {
  978. "text-color": "hsl(0, 0%, 0%)",
  979. "text-opacity": 1,
  980. "text-halo-color": "hsl(0, 0%, 100%)",
  981. "text-halo-width": 1,
  982. "icon-opacity": {
  983. "base": 1,
  984. "stops": [
  985. [
  986. 7.99,
  987. 1
  988. ],
  989. [
  990. 8,
  991. 0
  992. ]
  993. ]
  994. },
  995. "text-halo-blur": 1
  996. }
  997. });
  998. map.addLayer({
  999. "id": "China_ProCenCity_pt",
  1000. "type": "symbol",
  1001. "source": "vector-tiles",
  1002. "source-layer": "China_ProCenCity_pt@China",
  1003. "layout": {
  1004. "icon-image": "dot-15",
  1005. "text-font": {
  1006. "base": 1,
  1007. "stops": [
  1008. [
  1009. 7,
  1010. [
  1011. "DIN Offc Pro Regular",
  1012. "Arial Unicode MS Regular"
  1013. ]
  1014. ],
  1015. [
  1016. 8,
  1017. [
  1018. "DIN Offc Pro Medium",
  1019. "Arial Unicode MS Regular"
  1020. ]
  1021. ]
  1022. ]
  1023. },
  1024. "text-offset": {
  1025. "base": 1,
  1026. "stops": [
  1027. [
  1028. 7.99,
  1029. [
  1030. 0,
  1031. -0.25
  1032. ]
  1033. ],
  1034. [
  1035. 8,
  1036. [
  1037. 0,
  1038. 0
  1039. ]
  1040. ]
  1041. ]
  1042. },
  1043. "text-anchor": {
  1044. "base": 1,
  1045. "stops": [
  1046. [
  1047. 7,
  1048. "bottom"
  1049. ],
  1050. [
  1051. 8,
  1052. "center"
  1053. ]
  1054. ]
  1055. },
  1056. "text-field": "{NAME}",
  1057. "text-max-width": 7,
  1058. "text-size": {
  1059. "base": 0.9,
  1060. "stops": [
  1061. [
  1062. 4,
  1063. 12
  1064. ],
  1065. [
  1066. 10,
  1067. 22
  1068. ]
  1069. ]
  1070. }
  1071. },
  1072. "paint": {
  1073. "text-color": "hsl(0, 20%, 20%)",
  1074. "text-opacity": 1,
  1075. "text-halo-color": "hsl(0, 0%, 100%)",
  1076. "text-halo-width": 1,
  1077. "icon-opacity": {
  1078. "base": 1,
  1079. "stops": [
  1080. [
  1081. 7.99,
  1082. 1
  1083. ],
  1084. [
  1085. 8,
  1086. 0
  1087. ]
  1088. ]
  1089. },
  1090. "text-halo-blur": 1
  1091. }
  1092. });
  1093. map.addLayer({
  1094. "id": "China_ProCenCity_pt3",
  1095. "type": "symbol",
  1096. "source": "vector-tiles",
  1097. "source-layer": "China_ProCenCity_pt@China",
  1098. "layout": {
  1099. "icon-image": "circle-11",
  1100. "text-font": {
  1101. "base": 1,
  1102. "stops": [
  1103. [
  1104. 7,
  1105. [
  1106. "DIN Offc Pro Regular",
  1107. "Arial Unicode MS Regular"
  1108. ]
  1109. ],
  1110. [
  1111. 8,
  1112. [
  1113. "DIN Offc Pro Medium",
  1114. "Arial Unicode MS Regular"
  1115. ]
  1116. ]
  1117. ]
  1118. },
  1119. "text-offset": {
  1120. "base": 1,
  1121. "stops": [
  1122. [
  1123. 7.99,
  1124. [
  1125. 0,
  1126. -0.25
  1127. ]
  1128. ],
  1129. [
  1130. 8,
  1131. [
  1132. 0,
  1133. 0
  1134. ]
  1135. ]
  1136. ]
  1137. },
  1138. "text-anchor": {
  1139. "base": 1,
  1140. "stops": [
  1141. [
  1142. 7,
  1143. "bottom"
  1144. ],
  1145. [
  1146. 8,
  1147. "center"
  1148. ]
  1149. ]
  1150. },
  1151. "text-field": "{NAME}",
  1152. "text-max-width": 7,
  1153. "text-size": {
  1154. "base": 0.9,
  1155. "stops": [
  1156. [
  1157. 4,
  1158. 12
  1159. ],
  1160. [
  1161. 10,
  1162. 22
  1163. ]
  1164. ]
  1165. }
  1166. },
  1167. "paint": {
  1168. "text-color": "hsl(0, 20%, 20%)",
  1169. "text-opacity": 1,
  1170. "text-halo-color": "hsl(0, 0%, 100%)",
  1171. "text-halo-width": 1,
  1172. "icon-opacity": {
  1173. "base": 1,
  1174. "stops": [
  1175. [
  1176. 7.99,
  1177. 1
  1178. ],
  1179. [
  1180. 8,
  1181. 0
  1182. ]
  1183. ]
  1184. },
  1185. "text-halo-blur": 1
  1186. }
  1187. });
  1188. map.addLayer({
  1189. "id": "China_PreCenCity_pt3",
  1190. "type": "symbol",
  1191. "source": "vector-tiles",
  1192. "source-layer": "China_PreCenCity_pt@China",
  1193. "layout": {
  1194. "icon-image": "dot-11",
  1195. "text-font": {
  1196. "base": 1,
  1197. "stops": [
  1198. [
  1199. 7,
  1200. [
  1201. "DIN Offc Pro Regular",
  1202. "Arial Unicode MS Regular"
  1203. ]
  1204. ],
  1205. [
  1206. 8,
  1207. [
  1208. "DIN Offc Pro Medium",
  1209. "Arial Unicode MS Regular"
  1210. ]
  1211. ]
  1212. ]
  1213. },
  1214. "text-offset": {
  1215. "base": 1,
  1216. "stops": [
  1217. [
  1218. 7.99,
  1219. [
  1220. 0,
  1221. -0.25
  1222. ]
  1223. ],
  1224. [
  1225. 8,
  1226. [
  1227. 0,
  1228. 0
  1229. ]
  1230. ]
  1231. ]
  1232. },
  1233. "text-anchor": {
  1234. "base": 1,
  1235. "stops": [
  1236. [
  1237. 7,
  1238. "bottom"
  1239. ],
  1240. [
  1241. 8,
  1242. "center"
  1243. ]
  1244. ]
  1245. },
  1246. "text-field": "{NAME}",
  1247. "text-max-width": 7,
  1248. "text-size": {
  1249. "base": 0.9,
  1250. "stops": [
  1251. [
  1252. 4,
  1253. 12
  1254. ],
  1255. [
  1256. 10,
  1257. 22
  1258. ]
  1259. ]
  1260. }
  1261. },
  1262. "paint": {
  1263. "text-color": "hsl(0, 0%, 0%)",
  1264. "text-opacity": 1,
  1265. "text-halo-color": "hsl(0, 0%, 100%)",
  1266. "text-halo-width": 1,
  1267. "icon-opacity": {
  1268. "base": 1,
  1269. "stops": [
  1270. [
  1271. 7.99,
  1272. 1
  1273. ],
  1274. [
  1275. 8,
  1276. 0
  1277. ]
  1278. ]
  1279. },
  1280. "text-halo-blur": 1
  1281. }
  1282. });
  1283. map.addLayer({
  1284. "id": "China_PreCenCity_pt1",
  1285. "type": "symbol",
  1286. "source": "vector-tiles",
  1287. "source-layer": "China_PreCenCity_A_pt@China",
  1288. "layout": {
  1289. "icon-image": "dot-11",
  1290. "text-font": {
  1291. "base": 1,
  1292. "stops": [
  1293. [
  1294. 7,
  1295. [
  1296. "DIN Offc Pro Regular",
  1297. "Arial Unicode MS Regular"
  1298. ]
  1299. ],
  1300. [
  1301. 8,
  1302. [
  1303. "DIN Offc Pro Medium",
  1304. "Arial Unicode MS Regular"
  1305. ]
  1306. ]
  1307. ]
  1308. },
  1309. "text-offset": {
  1310. "base": 1,
  1311. "stops": [
  1312. [
  1313. 7.99,
  1314. [
  1315. 0,
  1316. -0.25
  1317. ]
  1318. ],
  1319. [
  1320. 8,
  1321. [
  1322. 0,
  1323. 0
  1324. ]
  1325. ]
  1326. ]
  1327. },
  1328. "text-anchor": {
  1329. "base": 1,
  1330. "stops": [
  1331. [
  1332. 7,
  1333. "bottom"
  1334. ],
  1335. [
  1336. 8,
  1337. "center"
  1338. ]
  1339. ]
  1340. },
  1341. "text-field": "{NAME}",
  1342. "text-max-width": 7,
  1343. "text-size": {
  1344. "base": 0.9,
  1345. "stops": [
  1346. [
  1347. 4,
  1348. 12
  1349. ],
  1350. [
  1351. 10,
  1352. 22
  1353. ]
  1354. ]
  1355. }
  1356. },
  1357. "paint": {
  1358. "text-color": "hsl(0, 0%, 0%)",
  1359. "text-opacity": 1,
  1360. "text-halo-color": "hsl(0, 0%, 100%)",
  1361. "text-halo-width": 1,
  1362. "icon-opacity": {
  1363. "base": 1,
  1364. "stops": [
  1365. [
  1366. 7.99,
  1367. 1
  1368. ],
  1369. [
  1370. 8,
  1371. 0
  1372. ]
  1373. ]
  1374. },
  1375. "text-halo-blur": 1
  1376. }
  1377. });
  1378. map.addLayer({
  1379. "id": "China_MainHydside_pg",
  1380. "type": "fill",
  1381. "source": "vector-tiles",
  1382. "source-layer": "China_MainHydside_pg@China",
  1383. "paint": {
  1384. "fill-color": "hsl(196, 80%, 70%)"
  1385. },
  1386. });
  1387. map.addLayer({
  1388. "id": "China_SecHydside_pl",
  1389. "type": "fill",
  1390. "source": "vector-tiles",
  1391. "source-layer": "China_SecHydside_pg_ip@China",
  1392. "paint": {
  1393. "fill-color": "hsl(196, 80%, 70%)"
  1394. },
  1395. });
  1396. map.addLayer({
  1397. "id": "District_A_pt",
  1398. "type": "symbol",
  1399. "source": "vector-tiles",
  1400. "source-layer": "District_pt@China",
  1401. "layout": {
  1402. "icon-image": "dot-9",
  1403. "text-font": {
  1404. "base": 1,
  1405. "stops": [
  1406. [
  1407. 7,
  1408. [
  1409. "DIN Offc Pro Regular",
  1410. "Arial Unicode MS Regular"
  1411. ]
  1412. ],
  1413. [
  1414. 8,
  1415. [
  1416. "DIN Offc Pro Medium",
  1417. "Arial Unicode MS Regular"
  1418. ]
  1419. ]
  1420. ]
  1421. },
  1422. "text-offset": {
  1423. "base": 1,
  1424. "stops": [
  1425. [
  1426. 7.99,
  1427. [
  1428. 0,
  1429. -0.25
  1430. ]
  1431. ],
  1432. [
  1433. 8,
  1434. [
  1435. 0,
  1436. 0
  1437. ]
  1438. ]
  1439. ]
  1440. },
  1441. "text-anchor": {
  1442. "base": 1,
  1443. "stops": [
  1444. [
  1445. 7,
  1446. "bottom"
  1447. ],
  1448. [
  1449. 8,
  1450. "center"
  1451. ]
  1452. ]
  1453. },
  1454. "text-field": "{NAME}",
  1455. "text-max-width": 7,
  1456. "text-size": {
  1457. "base": 0.9,
  1458. "stops": [
  1459. [
  1460. 4,
  1461. 12
  1462. ],
  1463. [
  1464. 10,
  1465. 22
  1466. ]
  1467. ]
  1468. }
  1469. },
  1470. "paint": {
  1471. "text-color": "hsl(0, 0%, 0%)",
  1472. "text-opacity": 1,
  1473. "text-halo-color": "hsl(0, 0%, 100%)",
  1474. "text-halo-width": 1,
  1475. "icon-opacity": {
  1476. "base": 1,
  1477. "stops": [
  1478. [
  1479. 7.99,
  1480. 1
  1481. ],
  1482. [
  1483. 8,
  1484. 0
  1485. ]
  1486. ]
  1487. },
  1488. "text-halo-blur": 1
  1489. }
  1490. });
  1491. });
  1492. </script>
  1493. </body>
  1494. </html>