错误内容:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'addLayer')
代码:
let param = new QueryBySQLParameters(
{
queryParams: {
name: "China_Province_pl@China",
// attributeFilter: `NAME='${name}'`
attributeFilter: "SmID=5"
},
}
)
new QueryService('https://iserver.supermap.io/iserver/services/map-china400/rest/maps/China')
.queryBySQL(param, function (serviceResult) {
console.log(serviceResult)
let result = serviceResult.result
L.geoJson(result.recordsets[0].features, {
style: function (feature) {
return {color: '#000'};
}
}).addTo(this.map);
});