<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="dist/leaflet/include-leaflet.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="width:1500px;height:800px"></div>
<script>
var host = window.isLocal ? window.server : "http://localhost:8090";
var SC = L.marker([30.39,103.01]).bindPopup('四川省');
var province = L.layerGroup([SC]);
var Vec = L.supermap.tiandituTileLayer({key:"9889d546b726a1ddac95a92d357eb8bd",layerType:"vec",noWrap:true});
var Img = L.supermap.tiandituTileLayer({key:"9889d546b726a1ddac95a92d357eb8bd",layerType:"img",noWrap:true});
var Ter = L.supermap.tiandituTileLayer({key:"9889d546b726a1ddac95a92d357eb8bd",layerType:"ter",noWrap:true});
var url = host + "/iserver/services/map-SiChuan/rest/maps/SiChuanMap";
var map = L.map("map",{
crs:L.CRS.EPSG4326,
center:{lon:103.01,lat:30.39},
zoom:5,
maxZoom:18,
layers: [Vec, province],
});
L.supermap.tiandituTileLayer({key:"9889d546b726a1ddac95a92d357eb8bd",
layerType:"vec"}).addTo(map);
//叠加地图图层,关键参数:transparent、opacity、noWrap
L.supermap.tiledMapLayer(url,{
transparent:true,
opacity:0.8,}).addTo(map);
var baseMaps = {
"矢量":Vec,
"影像":Img,
"地形":Ter
}var overlayMaps = {"Province" : province}; L.control.layers(baseMaps, overlayMaps).addTo(map);</script></body></html>