首页 / 浏览问题 / WebGIS / 问题详情
leaflet.js  加载不出地图    
2EXP 2026年06月23日
SuperMap.Include.js  能加载自己发布的地图http://192.168.0.194:8090/iserver/services/map-snQuanShiDiTu/rest/maps/zw@sn2018

leaflet.js  加载不出地图    

<script type="text/javascript" src="../js/include-web.js"></script>
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript" src="../../dist/leaflet/include-leaflet.js"></script>
<script type="text/javascript">
    var map, infowin;
    var url = "http://192.168.0.194:8090/iserver/services/map-snQuanShiDiTu/rest/maps/zw@sn2018";
    map = L.map('map', {
        preferCanvas: true,
        crs: L.CRS.EPSG4326,
        center: { lon: 105.56050855965084, lat: 30.53496986027998 },
        maxZoom: 18,
        zoom: 6
    });
    new L.supermap.TiledMapLayer(url).addTo(map);

</<script >

1个回答

您好,请确认坐标系正确,中心点坐标设置无误,center参数一般格式是数组,例如:center: [23.909946174843483, 17.607615853850504]

可以在示例中加载您的地图测试:https://iclient.supermap.io/examples/leaflet/editor.html#01_tiledMapLayer4326

如仍有问题,请提供详细报错截图,方便判断原因,谢谢。

750EXP 2026年06月23日
...