59 lines
3.2 KiB
HTML
59 lines
3.2 KiB
HTML
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>咸宁市电子地图(基于1:2000地形图)</title>
|
|
<link rel="stylesheet" href="http://172.18.130.6:8080/webframe/cdn/leaflet/1.2.0/dist/leaflet.css" />
|
|
<link rel="stylesheet" href="http://172.18.130.6:8080/webframe/cdn/@supermap/iclient-leaflet/9.1.2/dist/iclient9-leaflet.css" />
|
|
</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%;border: none;background: #fff;"></div>
|
|
<script type="text/javascript" src="http://172.18.130.6:8080/webframe/cdn/leaflet/1.2.0/dist/leaflet.js"></script>
|
|
<script type="text/javascript" src="http://172.18.130.6:8080/webframe/cdn/@supermap/iclient-leaflet/9.1.2/dist/iclient9-leaflet.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
var url = "http://172.18.130.6:8081/geoesb/proxy/9e3bbb3b4fc2412c9e0730aab27cd895/886e60bb7e014f22a707de23e6f6505d";
|
|
var matrixIds = [{"identifier":0},{"identifier":1},{"identifier":2},{"identifier":3},{"identifier":4},{"identifier":5},{"identifier":6},{"identifier":7},{"identifier":8},{"identifier":9},{"identifier":10},{"identifier":11},{"identifier":12},{"identifier":13},{"identifier":14},{"identifier":15},{"identifier":16},{"identifier":17},{"identifier":18},{"identifier":19},{"identifier":20}]
|
|
var urlParams = new URLSearchParams(window.location.search);
|
|
var jd = urlParams.get('jd');
|
|
var wd = urlParams.get('wd');
|
|
console.log(jd,wd,'经纬度信息')
|
|
// 只获取了 经纬度数据,其他数据还未获取
|
|
var center = [wd,jd];
|
|
console.log(center)
|
|
var map = L.map("map", {
|
|
center:center,//纬度,经度
|
|
zoom: 8,
|
|
crs: L.Proj.CRS("EPSG:4326", {
|
|
origin: [-180.0,90.0],
|
|
scales:null,
|
|
resolutions: [1.4062499999980482,0.7031249999990241,0.35156249999951317,0.17578124999975658,0.08789062499987829,0.043945312499939035,0.021972656249969517,0.01098632812498477,0.005493164062492385,0.002746582031246181,0.0013732910156230905,0.0006866455078115461,0.00034332275390577306,0.00017166137695288653,0.00008583068847644318,0.00004291534423822159,0.000021457672119110796,0.000010728836059555408,0.000005364418029777704,0.000002682209014888852,0.000001341104507444426],
|
|
bounds: L.bounds([113.53149335,29.032772597854002],[114.96819079700003, 30.31365754500007])
|
|
})
|
|
});
|
|
L.supermap.wmtsLayer(url,
|
|
{
|
|
layer: "XNS_SLMAP",
|
|
style: "default",
|
|
tilematrixSet: "CustomCRS4490ScaleXNS_SLMAP",
|
|
matrixIds: matrixIds,
|
|
format: "image/png",
|
|
requestEncoding: 'KVP',
|
|
}
|
|
).addTo(map);
|
|
//L.marker([29.673215071427038,114.24984207350002]).addTo(map).bindPopup('该档案所在位置').openPopup();
|
|
|
|
var mypop = L.popup();
|
|
map.on('click', function(e) {
|
|
var content = '该档案所在位置:<br>';
|
|
content += e.latlng.toString();
|
|
mypop.setLatLng(e.latlng)
|
|
.setContent(content)
|
|
.openOn(map);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |