SketchViewModel in SceneView: why are symbols highlighted?

398
3
Jump to solution
10-07-2019 08:07 PM
MichalGasparovic1
New Contributor III

Hi,

I'm implementing the sketch view model in order to simplify the drawing part of the application, and I wonder why is the symbol being highlighted during the drawing? I don't see anything like that in the 2D map.

I've setup the codepen

https://codepen.io/vajnorcan/pen/KKKwoZx 

Once it loads, just click the button and click and drag the mouse. You can see that the symbol is being highlighted, even though the default symbol doesn't have any halo around it (see the default symbols for the sketch view model SketchViewModel | ArcGIS API for JavaScript 4.12 )

How can I prevent the SketchViewModel features to be highlighted? Is that a bug or a feature?

Thank you

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Michal,

   There is a workaround for this:

        // Listen to sketch widget's create event.
        sketch.on('create', (event) => {
          // check if the create event's state has changed to complete indicating
          // the graphic create operation is completed.
          if (event.state === 'complete') {
            // this.identify(event);
            view.highlightOptions.haloOpacity = 1;
            view.highlightOptions.fillOpacity = 0.25;
          }
          view.highlightOptions.haloOpacity = 0;
          view.highlightOptions.fillOpacity = 0;
        });

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Michal,

   There is a workaround for this:

        // Listen to sketch widget's create event.
        sketch.on('create', (event) => {
          // check if the create event's state has changed to complete indicating
          // the graphic create operation is completed.
          if (event.state === 'complete') {
            // this.identify(event);
            view.highlightOptions.haloOpacity = 1;
            view.highlightOptions.fillOpacity = 0.25;
          }
          view.highlightOptions.haloOpacity = 0;
          view.highlightOptions.fillOpacity = 0;
        });
RalucaNicola1
Esri Contributor

This is a feature indeed, in 3D you might sketch objects that get occluded by other features and then highlight is the way to see the entire shape of your sketch when some parts are occluded. 

If you absolutely want to get rid of it, then I would go for Robert's solution. Not very nice, but the only one for now. We were discussing how to improve this behavior and one option would be to make the highlight more subtle. Would that work for you or would you just want to be able to turn it off?

MichalGasparovic1
New Contributor III

Hi Raluca, thanks for the update and clarifying of what I suspected was intended behavior. I think it would be great if the developers have the option of turning this on/off on the sketch widget (sketch view model). 

Thanks

0 Kudos