SQL查询F12报错 [已关闭]

0 投票

我无法使用自己发布的rest数据服务,然后用超图自带的example SQL查询 rest数据服务是可以的,但是就算是超图的 我用console(sqlParam);   console( resultLayer);查看属性,F12报错,说是sqlParam没有被定义? Uncaught ReferenceError: sqlParam is not defined

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>数据集SQL查询</title>
</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/include-leaflet.js"></script>
<script type="text/javascript">
    var host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090";
    var map, resultLayer,
        baseUrl = host + "/iserver/services/map-world/rest/maps/World",
        url = host + "/iserver/services/data-world/rest/data";
    map = L.map('map', {
        preferCanvas: true,
        crs: L.CRS.EPSG4326,
        center: {lon: 0, lat: 0},
        maxZoom: 18,
        zoom: 1
    });
    L.supermap.tiledMapLayer(baseUrl).addTo(map);
    query();

    function query() {
        var sqlParam = new SuperMap.GetFeaturesBySQLParameters({
            queryParameter: {
                name: "Countries@World",
                attributeFilter: "SMID = 247"
            },
            datasetNames: ["World:Countries"]
        });
        L.supermap
            .featureService(url)
            .getFeaturesBySQL(sqlParam, function (serviceResult) {
                resultLayer = L.geoJSON(serviceResult.result.features).addTo(map).bindPopup('SMID = 247');
            });
    };
 console(sqlParam);
 console( resultLayer);
 
</script>
</body>
</html>

关闭重复的问题: SQL查询F12报错
7月 27, 2018 分类:  69次浏览 | 用户: parin0520 初出茅庐 (24 分)
已关闭 7月 30, 2018 用户:李熙y
...