ArcGIS for js 4.x FeatureLayer 点选查询
示例:
代码如下:
#mapView{
width: 100%;
height:100vh;
padding: 0;
margin: 0;
}
定位也可以写成下面的方式:
// 创建PopupTemplate实例
var popupTemplate = new PopupTemplate({
content:(feature)=>{
// 定位
mapView.goTo({
target:feature.graphic,
zoom:13
});
for(let key in feature.graphic.attributes){
if(feature.graphic.attributes[key]){
// 输出全部属性值
console.log(feature.graphic.attributes[key]);
}
}
}
});