多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
文件引入 ~~~ <link rel="stylesheet" href="leaflet/leaflet.css"> <script src="leaflet/leaflet.js"></script> ~~~ ## 一、添加地图瓦片,以google map为例 ~~~ var map = L.map('js_map', { center: [25.1049040686, 102.9331224074], zoom: 13, }); L.tileLayer('http://www.google.cn/maps/vt?lyrs=m@189&gl=cn&x={x}&y={y}&z={z}').addTo(map); ~~~ ## 二、添加wms层 ~~~ L.tileLayer.wms("http://map.xxx.com/geoserver/kmg/wms", { layers: 'kmg:vector', format: 'image/png', transparent: true, attribution: "", service:'WMS', version:'1.3.0', request:'GetMap', srs:L.CRS.EPSG3857, width:256, height:256 }).addTo(map); ~~~ 参考链接: 【取地图瓦片数据】https://github.com/htoooth/Leaflet.ChineseTmsProviders