AnsweredAssumed Answered

4.12 SceneView: scene's graphics layer view reference?

Question asked by michal.gasparovic@bhp.com_bhp on Sep 13, 2019

Hi,

 

is there a way to get the reference to the default scene's graphics layer view? 

 

I have features coming from the identify, for which I have proper symbols assigned. There features are not part of any graphics layer (nor any other layer type).
I provide the array of these features to the popup to display the popup, and at the same time I've created a event hook on the popup's own 'selectedFeature' property change, with the idea of adding the relevant graphic into the view's graphics collection.

this.esriLib.watchUtils.watch(view.popup, 'selectedFeature', (feature) => {      
      if (feature && feature.symbol) {
        this.highlightGraphic = feature.clone();
        view.graphics.add(this.highlightGraphic);
      }
    });

 

It does render the graphics properly. However, what I'd like to achieve is to highlight the selected feature. It won't highlight it out-of-the box as the feature is not part of any layer, only the view's graphics.

 

I'd like to know, if there is a way to get the reference to the view's graphics layer (the default one), so I could eventually call let's say view.graphics.layerView.highlight(selectedFeature)

 

Is there a way to do that? I've traversed the view's object front and back but couldn't find a graphic's layer nor layer-view.

 

Thank you upfront.

 

Note: I know I can place the identified graphics into a new, separate graphics layer and completele delete the 'selectedFeature' watch handle, and it will work, but that will display all features at the same time which is what I'd like to avoid. hence the question. 

Outcomes