GraphicsLayer 、图层服务、FeatureLayer属性值查询

1.GraphicsLayer : 

const graphic =this.layers.HospitalLayer.graphics.items.find(item => {

return item.attributes.projectid === row.projectId

})

2.图层服务

const queryTask =new this.$esri.QueryTask({

url:`${layerUrl.YTH_SBSS_CUN_GRID}/0`

})

const query =new this.$esri.Query({

returnGeometry:true,

outFields: ['*'],

where:`CUNCODE = '${val.attributes.cuncode}'`

})

queryTask.execute(query).then(res => {

if (res.features.length ===0) {

return

    }

console.log(res.features)

const coor = res.features[0].geometry.extent.center

    if (res.features.length) {

const point =new this.$esri.Point({

type:'point',

x:coor.x,

y:coor.y,

spatialReference:this.$mapView.spatialReference

        })

this.clickEventHandle(point)

}

})

3.FeatureLayer

const query =layer.createQuery()

query.where =`swid = '${row.id}'`

const results =await layer.queryFeatures(query)

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容