高亮显示点要素

尝试一下在线预览

此示例显示如何突出显示图层中的要素。可以突出显示 SceneLayerFeatureLayerCSVLayerGeoRSSLayerGraphicsLayer 中的要素。

要突出一个要素,调用该要素对应的 layerViewhighlight 方法,以该特征或其 objectID 作为参数。将要素作为参数传递时,它们需要有一个 objectID

         
1
2
3
4
5
6
7
8
9
view.whenLayerView(layer).then((layerView) => {
  // if a feature is already highlighted, then remove the highlight
  if (highlightSelect) {
    highlightSelect.remove();
  }

  // set the highlight on the first feature returned by the query
  highlightSelect = layerView.highlight(feature);
});

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.