/iserver/services/data-wk2D1/rest/data 这种数据用几何查询返回错误:
"error": {
"code": 404,
"errorMsg": "请求url /iserver/services/data-wk2D1/rest/data/queryResults.json 与资源data 的 url 模板不匹配"
},
//查询
function query(X, Y) {
var latlngs = [
[X - 0.000010, Y - 0.000010],
[X + 0.000010, Y - 0.000010],
[X + 0.000010, Y + 0.000010],
[X - 0.000010, Y + 0.000010]
];
var polygon = L.polygon(latlngs, {
color: 'red'
});
polygon.addTo(map);
var param = new SuperMap.QueryByGeometryParameters({
queryParams: {
name: mapLayerName[indexLayer]
},
geometry: polygon
});
L.supermap
.queryService(dataUrl)
.queryByGeometry(param, function(serviceResult) {
//var result = serviceResult.result.;
console.log("查询结果:", serviceResult);
indexLayer++;
if (indexLayer < mapLayerName.length) {
query(X, Y);
}
});
}