<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>mytest</title> <script type="text/javascript" src="dist/leaflet/include-leaflet.js"></script> </head> <body> <div id="mymap" style="width: 800px;height: 700px;"></div> <script type="text/javascript"> var map, url="http://localhost:8090/iserver/services/map-ChengduFresh/rest/maps/ChengduMap"; //创建地图对象 var map=L.map('mymap',{ center:[30.67,104.08], maxZoom:22, zoom:0 }); //添加图层到map中 L.supermap.tiledMapLayer(url).addTo(map); </script> </body> </html>
您好,您服务坐标系为4326坐标系,前端加载时没有声明坐标系,您可以参考以下代码加上坐标系参数:
map = L.map('map', { crs: L.CRS.EPSG4326, center: [0, 0], maxZoom: 18, zoom: 1 });