泰森多边形没有结果

0 投票
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title data-i18n="resources.title_thiessenAnalystDataset"></title>
    <script type="text/javascript" src="js/include-web.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>
    <script type="text/javascript" src="dist/leaflet/include-leaflet.js"></script>
    <script type="text/javascript">
    var map, thiessenAnalystService, dsThiessenAnalystParameters, resultLayer,
        baseUrl = "http://localhost:8090/iserver/services/map-TangShan/rest/maps/QuXian%40Tang",
        serviceUrl = "http://localhost:8090/iserver/services/spatialAnalysis-TangShan/restjsr/spatialanalyst";
    map = L.map('map', {
        preferCanvas: true,
        center: [39.7, 118],
        maxZoom: 18,
        zoom: 9
    });
    L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map);

    thiessenAnalystProcess();

    function thiessenAnalystProcess() {
        thiessenAnalystService = L.supermap.spatialAnalystService(serviceUrl);
        dsThiessenAnalystParameters = new SuperMap.DatasetThiessenAnalystParameters({
            dataset: "Education@Tang"
        });
        thiessenAnalystService.thiessenAnalysis(dsThiessenAnalystParameters, function (serviceResult) {
            resultLayer = L.geoJSON(serviceResult.result.regions, {weight: 2}).addTo(map);
        });
    }
    </script>
</body>
</html>

泰森多边形,对教育点。但是代码与控制台没有任何报错,然而没有结果显示,求大佬解答,地图底图是3857的
8月 17, 2020 分类:  149次浏览 | 用户: 胡皮皮 才疏学浅 (16 分)

1个回答

0 投票

您好,您可以打印下serviceResult.result是否有返回的数据,如果存在证明分析的没有问题,因leaflets是以地理坐标的方式展示数据,因此您需要利用L.Util.transform(feature, sourceCRS, targetCRS)对resultlayer进行坐标的转换。具体您可以参考https://blog.csdn.net/supermapsupport/article/details/79581665

8月 17, 2020 用户: 阳俊林 名扬四海 (3,347 分)
...