當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


JavaScript ArcGIS GeoRSSLayerView.highlight用法及代碼示例

基本信息

以下是所在類或對象的基本信息。

類: esri/views/layers/GeoRSSLayerView

繼承: GeoRSSLayerView > LayerView > Accessor

自從:用於 JavaScript 4.0 的 ArcGIS API

用法說明

GeoRSSLayerView.highlight函數(或屬性)的定義如下:

highlight (target) {Handle}


自從:ArcGIS 適用於 JavaScript 4.4 的 API

突出顯示給定的特征。

已知限製

目前僅在 SceneView 中支持突出顯示方法。

參數:

類型說明
可選的

要突出顯示的函數。

返回:

類型 說明
Handle 返回帶有 remove() 方法的高亮處理程序,可以調用該方法來刪除高亮顯示。

例子:

// highlight feature on click
view.on("click", function(event){
  view.hitTest(event).then(function(response){
    if (response.results.length) {
      let graphic = response.results.filter(function (result) {
        return result.graphic.layer === myLayer;
      })[0].graphic;

     view.whenLayerView(graphic.layer).then(function(lyrView){
       lyrView.highlight(graphic);
     });
    }
  });
});

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 GeoRSSLayerView.highlight。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。