js API 4.8高亮显示
在mapView中采用FeatureLayerView 中的highlight()方法是图形单击高亮,代码如下:var highlight;
view.on("click",function(event){
if(highlight){
highlight.remove();
}
view.hitTest(event).then(function(response){
if(response.results[0]){
var graphic = response.results[0].graphic;
view.whenLayerView(graphic.layer).then(function(lyrView){
console.log(lyrView)
highlight = lyrView.highlight(graphic);
console.log(highlight)
})
}
})
});
也开启了webgl的渲染, var dojoConfig = {
has: {
"esri-featurelayer-webgl": 1
}
};为什么还是没有作用啊?
view.on("click",function(event){
if(highlight){
highlight.remove();
}
view.hitTest(event).then(function(response){
if(response.results[0]){
var graphic = response.results[0].graphic;
view.whenLayerView(graphic.layer).then(function(lyrView){
console.log(lyrView)
highlight = lyrView.highlight(graphic);
console.log(highlight)
})
}
})
});
也开启了webgl的渲染, var dojoConfig = {
has: {
"esri-featurelayer-webgl": 1
}
};为什么还是没有作用啊?
1 个回复
许丹石
赞同来自:
要回复问题请先登录或注册