<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script type="text/javascript" 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="margin:0 auto;width: 100%;height:100%"></div>
<script>
var url = "http://192.168.48.119:8081/geoesb/proxy/services/maps/rest/e6e566a91e78468fabbc9c531a057da6/886e60bb7e014f22a707de23e6f6505d";
// var res = [611.496226281409, 305.748113140706,
// 152.874056570352, 76.4370282851762,
// 38.2185141425882, 19.1092570712941,
// 9.55462853564703, 4.77731426782351];
map = L.map("map", {
center: [ 85962.17 , 2689538.35],
maxZoom: 18,
zoom: 2,
crs: new L.Proj.CRS("EPSG:3857", {
origin: [7844.058, 2882954.0],
// resolutions: res,
bounds: L.bounds([83277.55 , 2684582.55], [188643.65 , 2694908.33])
})
})
L.supermap.tiledMapLayer(url, {noWrap: true}).addTo(map);
layerService();
function layerService() {
L.supermap
.layerInfoService(url)
.getLayersInfo(function (serviceResult) {
var result = serviceResult.result;
var innerHTML = "";
result.subLayers.layers.map(function (layer) {
innerHTML += layer.name + "<br>";
});
infowin = L.popup({maxWidth: 1000})
.setLatLng(map.getCenter())
.setContent(innerHTML)
.openOn(map);
});
}
</script>
</body>
<ml>