FeatureLayer点击事件没有响应

 featureLayer.on("click", function(event) {
             console.log(arrt);
});
有时候在点击图层不响应click事件。
已邀请:

zyanj2002

赞同来自:

initMainViewClick() { //添加点击事件 let self = this; self.mainView.on("click", function (event) { self.mainView.hitTest(event).then(function (response) { var result = response.results[0]; if (result && result.graphic) { var graphic = result.graphic; graphic.symbol = { type: "simple-fill", style: 'none', outline: { type: "simple-line", color: [176, 255, 255, 1], width: 2, style: "solid" } }; self.mainView.graphics.removeAll();//清除上一次点击目标 self.mainView.graphics.add(graphic);//添加新的点击目标 } }) }) },
 

要回复问题请先登录注册