<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>
代码如图,但运行时出现请求头文件错误