在使用iclient for leaflet中的FeatureService

0 投票
<script type="text/javascript">
		var resultLayer;
		var mapurl='http://localhost:8090/iserver/services/map-China100-1/rest/maps/China'
		var dataURL='http://localhost:8090/iserver/services/data-China100-1-3/rest/data';
		var map=L.map('map', {
        	preferCanvas: true,
        	center: [39, 100],
        	maxZoom: 18,
        	zoom: 5
    	});
    	L.supermap.tiledMapLayer(mapurl).addTo(map);


    	query();
    	function query(){

        	var sqlParam = new SuperMap.GetFeaturesBySQLParameters({
            	queryParameter: {
                	name: "China_Province_pg@China",
                	attributeFilter: "SMID < 34"
            	},
            	datasetNames: ["China:China_P"]
        	});
        	L.supermap.featureService(dataURL).getFeaturesBySQL(sqlParam, function (serviceResult) {
        		console.log(serviceResult.result.features);
        	});
    	}	

    </script>

代码如图,但运行时出现请求头文件错误

7月 8, 2020 分类:  92次浏览 | 用户: 刘培茄中校拒绝返回休眠仓 (6 分)

1个回答

0 投票

你好400的话是语句错误,您可以修改一下查询语句,数据集为“null”的语句不用写,可参考示例代码https://iclient.supermap.io/examples/leaflet/editor.html#02_getFeatureBySQL

7月 8, 2020 用户: 张亮 名扬四海 (1,894 分)
...