1、MapServer 0图层中的属性字段,下面括号中的为筛选条件
fl.setDefinitionExpression("Shape_Area" + " > " + classifyField2 +" and "+ "YDDM" + " like '" + classifyField1 + "%'");
2、FeatureLayer0图层中的属性字段,下面括号中的为筛选条件
const dotfeatureLayer = new FeatureLayer({
url:"http://localhost:6080/arcgis/rest/services/classifyServer/estateServer/FeatureServer/0",
mode: FeatureLayer.MODE_SNAPSHOT,//数据一次加载迕来,当再次移动地图,范围改变的时候,不再向服务器请求
outFields: ["*"],
popupTemplate: BuildInfo,
})
map.add(dotfeatureLayer)
dotfeatureLayer.definitionExpression="buildid in ('cf13cc28-451e-43e9-99ec-4424ba29d213','826e57d2-5273-4ec2-8c1e-9d4959ac9226','d1f815b6-857a-4439-889a-b14dbe544b01','a5ff1ff9-943e-46cb-a146-a1c2f25ef457')";
dotfeatureLayer.definitionExpression ="OBJECTID>100";
console.log(dotfeatureLayer)
dotfeatureLayer.queryFeatures().then(function(results){
console.log(results.features);
// _that.featList = results.features
results.features.forEach((item,index)=>{
if(index<10){
console.log(item)
layer.graphics.add(item);
}
})
})