12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073 |
- <!--********************************************************************
- * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- *********************************************************************-->
- <html>
- <head>
- <meta charset='utf-8'/>
- <title data-i18n="resources.title_beijingMVTVectorTile"></title>
- <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
- <script type="text/javascript" src="../js/include-web.js"></script>
- <script type="text/javascript" exclude='iclient-mapboxgl' src="../../dist/mapboxgl/include-mapboxgl.js"></script>
- <style>
- body {
- margin: 0;
- padding: 0;
- }
- #map {
- position: absolute;
- top: 0;
- bottom: 0;
- width: 100%;
- }
- </style>
- </head>
- <body>
- <div id='map'></div>
- <script type="text/javascript">
- var host = window.isLocal ? window.server : "https://iserver.supermap.io";
- var attribution = "<a href='https://www.mapbox.com/about/maps/' target='_blank'>© Mapbox </a>" +
- " with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a> | </span>" +
- " Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> ";
- var map = new mapboxgl.Map({
- container: 'map', // container id
- style: {
- "version": 8,
- "sources": {
- "vector-tiles": {
- "attribution": attribution,
- "type": "vector",
- "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"
- ]
- },
- },
- "sprite": "https://iclient.supermap.io/web/styles/street/sprite",
- "glyphs": host + "/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf",
- "layers": []
- },
- center: [116.4, 39.9],
- minZoom: 10,
- zoom: 11
- });
- map.addControl(new mapboxgl.NavigationControl(), 'top-left');
- map.on('load', function() {
- map.addLayer({
- "id": "background",
- "type": "background",
- "layout": {},
- "paint": {
- "background-color": "#75CFF0"
- }
- });
- map.addLayer({
- "id": "面区界R@北京",
- "type": "fill",
- "source": "vector-tiles",
- "source-layer": "面区界R@北京",
- "paint": {
- "fill-color": "#EFE9E1",
- }
- });
- map.addLayer({
- "id": "界线@北京",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "界线@北京",
- "paint": {
- "line-color": "hsl(240, 8%, 51%)",
- "line-width": 0.5
- }
- });
- map.addLayer({
- "id": "立交桥绿地R@北京",
- "type": "fill",
- "source": "vector-tiles",
- "source-layer": "立交桥绿地R@北京",
- "paint": {
- "fill-color": "hsl(100, 58%, 76%)",
- "fill-opacity": {
- "base": 1,
- "stops": [
- [
- 5,
- 0
- ],
- [
- 6,
- 0.5
- ]
- ]
- }
- },
- });
- map.addLayer({
- "id": "绿地R@北京",
- "type": "fill",
- "source": "vector-tiles",
- "source-layer": "绿地R@北京",
- "paint": {
- "fill-color": "hsl(100, 58%, 76%)",
- "fill-opacity": {
- "base": 1,
- "stops": [
- [
- 5,
- 0
- ],
- [
- 6,
- 0.5
- ]
- ]
- }
- },
- });
- map.addLayer({
- "id": " 双线河R@北京",
- "type": "fill",
- "source": "vector-tiles",
- "source-layer": "双线河R@北京",
- "paint": {
- "fill-color": "hsl(196, 80%, 70%)"
- }
- });
- map.addLayer({
- "id": "湖泊、水库R@北京",
- "type": "fill",
- "source": "vector-tiles",
- "source-layer": "湖泊、水库R@北京",
- "paint": {
- "fill-color": "hsl(196, 80%, 70%)"
- }
- });
- map.addLayer({
- "id": " 四级道路L@北京",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "四级道路L@北京",
- "paint": {
- "line-width": {
- "base": 1.5,
- "stops": [
- [
- 11,
- 1
- ],
- [
- 18,
- 10
- ]
- ]
- },
- "line-color": "hsl(0, 0%, 100%)",
- }
- });
- map.addLayer({
- "id": " 三级道路L@北京",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "三级道路L@北京",
- "paint": {
- "line-width": {
- "base": 1.5,
- "stops": [
- [
- 11,
- 1
- ],
- [
- 18,
- 10
- ]
- ]
- },
- "line-color": "hsl(0, 0%, 100%)",
- }
- });
- map.addLayer({
- "id": " 二级道路L@北京",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "二级道路L@北京",
- "paint": {
- "line-width": 4,
- "line-color": "hsl(230, 24%, 87%)",
- }
- });
- map.addLayer({
- "id": " 二级道路L@北京1",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "二级道路L@北京",
- "paint": {
- "line-width": {
- "base": 1.5,
- "stops": [
- [
- 11,
- 2
- ],
- [
- 18,
- 18
- ]
- ]
- },
- "line-color": "hsl(0, 0%, 100%)",
- }
- });
- map.addLayer({
- "id": "一级道路L@北京1",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "一级道路L@北京",
- "paint": {
- "line-width": {
- "base": 1.5,
- "stops": [
- [
- 11,
- 6
- ],
- [
- 18,
- 26
- ]
- ]
- },
- "line-color": "hsl(230, 24%, 87%)",
- "line-opacity": {
- "base": 1,
- "stops": [
- [
- 10.99,
- 0
- ],
- [
- 11,
- 1
- ]
- ]
- },
- }
- });
- map.addLayer({
- "id": "一级道路L@北京",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "一级道路L@北京",
- "paint": {
- "line-width": {
- "base": 1.5,
- "stops": [
- [
- 11,
- 4
- ],
- [
- 18,
- 20
- ]
- ]
- },
- "line-color": "hsl(0, 0%, 100%)",
- "line-opacity": {
- "base": 1,
- "stops": [
- [
- 10.99,
- 0
- ],
- [
- 11,
- 1
- ]
- ]
- },
- }
- });
- map.addLayer({
- "id": " 省道L@北京",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "省道L@北京",
- "paint": {
- "line-width": {
- "base": 1.5,
- "stops": [
- [
- 10,
- 6
- ],
- [
- 18,
- 36
- ]
- ]
- },
- "line-color": "hsl(26, 87%, 62%)",
- }
- });
- map.addLayer({
- "id": " 省道L@北京1",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "省道L@北京",
- "paint": {
- "line-width": {
- "base": 1.5,
- "stops": [
- [
- 10,
- 4
- ],
- [
- 18,
- 32
- ]
- ]
- },
- "line-color": "hsl(35, 32%, 91%)"
- }
- });
- map.addLayer({
- "id": " 高速公路L@北京",
- "type": "line",
- "source": "vector-tiles",
- "source-layer": "高速公路L@北京",
- "paint": {
- "line-width": {
- "base": 1.5,
- "stops": [
- [
- 11,
- 6
- ],
- [
- 18,
- 32
- ]
- ]
- },
- "line-color": "hsl(26, 87%, 62%)",
- }
- });
- map.addLayer({
- "id": "区政府驻地@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "区政府驻地@北京",
- "layout": {
- "text-offset": [-1.5, -0.5],
- "text-anchor": "bottom-left",
- "text-field": "{NAME}",
- "text-max-width": 7,
- "text-font": [
- "DIN Offc Pro Medium",
- "Arial Unicode MS Regular"
- ],
- "text-size": 22
- },
- "paint": {
- "text-color": "hsl(230, 8%, 62%)",
- "text-opacity": {
- "base": 1,
- "stops": [
- [
- 11.99,
- 1
- ],
- [
- 12,
- 0
- ]
- ]
- },
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "标志建筑@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "标志建筑@北京",
- "layout": {
- "text-offset": [-1.5, -0.5],
- "text-anchor": "bottom-left",
- "text-field": "{NAME}",
- "text-max-width": 7,
- "text-size": 14
- },
- "paint": {
- "text-color": "hsl(26, 25%, 32%)",
- "text-opacity": {
- "base": 1,
- "stops": [
- [
- 10.99,
- 0
- ],
- [
- 11,
- 1
- ]
- ]
- },
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": " 一级道路Name",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "一级道路L@北京",
- "layout": {
- "text-line-height": 1.1,
- "text-size": {
- "base": 1.5,
- "stops": [
- [
- 13.99,
- 12
- ],
- [
- 20,
- 24
- ]
- ]
- },
- "text-font": [
- "DIN Offc Pro Italic",
- "Arial Unicode MS Regular"
- ],
- "symbol-placement": "line",
- "text-field": "{道路名称}",
- "text-letter-spacing": 0.1,
- "text-max-width": 5
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1.25,
- "text-opacity": {
- "base": 1,
- "stops": [
- [
- 13.99,
- 0
- ],
- [
- 14,
- 1
- ]
- ]
- },
- },
- });
- map.addLayer({
- "id": " 省道Name",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "省道L@北京",
- "layout": {
- "text-line-height": 1.1,
- "text-size": {
- "base": 1.5,
- "stops": [
- [
- 11,
- 10
- ],
- [
- 18,
- 24
- ]
- ]
- },
- "text-font": [
- "DIN Offc Pro Italic",
- "Arial Unicode MS Regular"
- ],
- "symbol-placement": "line",
- "text-field": "{道路名称}",
- "text-letter-spacing": 0.1,
- "text-max-width": 5
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1.25,
- "text-opacity": {
- "base": 1,
- "stops": [
- [
- 10.99,
- 0
- ],
- [
- 11,
- 1
- ]
- ]
- },
- },
- });
- map.addLayer({
- "id": "立交桥名称P@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "立交桥名称P@北京",
- "layout": {
- "text-offset": [-1, -1],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 14
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "长途汽车站@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "长途汽车站@北京",
- "layout": {
- "icon-image": "bus-11",
- "text-offset": [-1, -1],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "图书馆@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "图书馆@北京",
- "layout": {
- "icon-image": "library-11",
- "text-offset": [-1, -1],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "公园@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "公园@北京",
- "layout": {
- "icon-image": "park-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "综合性广场@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "综合性广场@北京",
- "layout": {
- "icon-image": "campsite-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "旅游景点@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "旅游景点@北京",
- "layout": {
- "icon-image": "volcano-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "医疗卫生@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "医疗卫生@北京",
- "layout": {
- "icon-image": "hospital-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "娱乐场所@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "娱乐场所@北京",
- "layout": {
- "icon-image": "amusement-park-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "大厦@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "大厦@北京",
- "layout": {
- "icon-image": "picnic-site-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "文化场所@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "文化场所@北京",
- "layout": {
- "icon-image": "art-gallery-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "运动场所@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "运动场所@北京",
- "layout": {
- "icon-image": "bicycle-share-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "交通运输@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "交通运输@北京",
- "layout": {
- "icon-image": "bakery-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "其它@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "其它@北京",
- "layout": {
- "icon-image": "toilet-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "filter": [
- "==",
- "NAME",
- "公厕"
- ],
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "服务行业@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "服务行业@北京",
- "layout": {
- "icon-image": "embassy-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "其它@北京2",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "其它@北京",
- "layout": {
- "icon-image": "car-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "filter": [
- "==",
- "NAME",
- "停车场"
- ],
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "邮政电信@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "邮政电信@北京",
- "layout": {
- "icon-image": "post-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 10,
- "text-max-width": 18
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "商场@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "商场@北京",
- "layout": {
- "icon-image": "grocery-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "综合性商店@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "综合性商店@北京",
- "layout": {
- "icon-image": "grocery-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "饭店@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "饭店@北京",
- "layout": {
- "icon-image": "restaurant-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "加油站@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "加油站@北京",
- "layout": {
- "icon-image": "fuel-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "建筑@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "建筑@北京",
- "layout": {
- "icon-image": "place-of-worship-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "码头@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "码头@北京",
- "layout": {
- "icon-image": "harbor-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "机场@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "机场@北京",
- "layout": {
- "icon-image": "airport-11",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "火车站@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "火车站@北京",
- "layout": {
- "icon-image": "rail-15",
- "text-offset": [0, -0.5],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- map.addLayer({
- "id": "地名@北京",
- "type": "symbol",
- "source": "vector-tiles",
- "source-layer": "地名@北京",
- "layout": {
- "icon-image": "dot-11",
- "text-offset": [0, -0.3],
- "text-anchor": "bottom",
- "text-field": "{NAME}",
- "text-size": 12
- },
- "paint": {
- "text-color": "hsl(0, 0%, 0%)",
- "text-opacity": 1,
- "text-halo-color": "hsl(0, 0%, 100%)",
- "text-halo-width": 1,
- "text-halo-blur": 1
- }
- });
- });
- </script>
- </body>
- </html>
|