首页 / 浏览问题 / WebGIS / 问题详情
加载后显示地图特别小,并出现地图重复
10EXP 2020年08月06日
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="leaflet/leaflet.css" />
    <link rel="stylesheet" href="supermap_iclient_1010/dist/leaflet/iclient-leaflet.min.css" />
    <script type="text/javascript" src="leaflet/leaflet.js"></script>
    <script type="text/javascript" src="supermap_iclient_1010/dist/leaflet/iclient-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>
</body>
<script type="text/javascript">
    var host = window.isLocal ? window.server : "http://localhost:8090";
    var map, url = host + "/iserver/services/map-test/rest/maps/guizhou@test5";
    map = L.map('map', {
        crs: L.CRS.EPSG4326,
        center: [106.75 , 27.0],
        maxZoom: 18,
        zoom: 1
    });
    L.supermap.tiledMapLayer(url).addTo(map);
</script>
</html>

1个回答

您好,您这个问题是因为您的代码问题,您可以参考我们的官范例来修改您的代码https://iclient.supermap.io/examples/leaflet/editor.html#01_imageMapLayer4326

2,243EXP 2020年08月06日
已经完全参考您们给的示例了
请问您在iServer中预览也是这种情况吗?

在server里是正常的

那您直接在官网范例中使用您的服务测试是否也是正常的,如果能正常出图的话,应该就是您代码中js文件引用的问题了。

用官方示例引用自己的测试服务还是这样

您好,我看您发的图片已经有地图那块了,您修改一下center和zoom的值,使其能够定位到相应的位置,再查看是否正常。
好的谢谢
通过在iserver中获取到的中心位置是与iclient中的中心位置x,y是相反的
是的,在leaflet中的中心点和在iServer中的中心点的x,y是相反的。
...