arcgic点击选中空间查询并显示高亮

// 查询并高亮显示点,根据自己代码自行修改

queryHighLight (featureLayer, lon, lat) {

JTMapKit.mapView.whenLayerView(featureLayer).then((layerView) => {

var query = featureLayer.createQuery()

query.spatialRel ='esriSpatialRelIntersects'

    query.returnGeometry =true // 是否返回图形

    query.returnQueryGeometry =true

    // 空间查询的几何对象

    query.geometry = {

type:'point',

longitude: lon,

latitude: lat

}

featureLayer.queryFeatures(query).then((result) => {

if (this.hasHighlight) {

this.hasHighlight.remove()

}

this.hasHighlight = layerView.highlight(result.features)

})

})

}

你可能感兴趣的:(arcgic点击选中空间查询并显示高亮)