以下是我写的代码:
<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 -->
<div id="mymap" style="margin: 0 auto; width: 100%; height: 100% ;"> </div>
<script type="text/javascript" include="echarts" src="./dist/leaflet/include-leaflet.js"></script>//引入echarts图表和组件
<script type="text/javascript">
var map,url="http://localhost:8090/iserver/services/map-China100/rest/maps/China_4326";//map对象以及数据的url地址
//创建map对象,设置地图属性
var map = L.map('mymap', {
crs:L.CRS.EPSQ4326,
center: [0,0],
zoom: 13 //3-19\
});
new L.supermap.MapService(url).getMapInfo((res) => {
var map = L.map('map', {
crs: crs,
center: [23.909946174843483, 17.607615853850504],
maxZoom: 18,
zoom: 0
});
new L.supermap.TiledMapLayer(url).addTo(map);
});</script>
还有一个问题,就我,我只编辑两个字,粘贴一张小的图片,就显示最长8000个字符,就是不能粘贴图片,哎,心窄