SketchViewModel Active Graphic Highlight Effect

613
6
11-22-2019 10:51 AM
MichaelDenholtz
New Contributor II

When creating or updating a graphic using the SketchViewModel there is a teal highlight on that graphic that remains visible even if the graphic's visible property is set to false. Can the highlight effect be modified in any way?

0 Kudos
6 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

You should not be able to select a graphic that is not visible. I am not completely clear on your workflow. Can you please create a simple test app?

Thanks,

-Undral

0 Kudos
MichaelDenholtz
New Contributor II

Hi Undral. Thanks for your response.

Sketch in 3D | ArcGIS API for JavaScript 4.13 

In this sample when you create a route, building, or POI in addition to the white coloring of the graphic itself there is a light blue highlight effect around the graphic being created or edited. Is it possible to change that highlight effect?

0 Kudos
MichaelDenholtz
New Contributor II

Hi,

Any information on this? Is it still unclear what I'm referring to?

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

I just saw your question. I am sorry for not replying sooner. Tagging our 3D expert here. Raluca Nicola‌. 

Thanks,

-Undral

0 Kudos
RalucaNicola1
Esri Contributor

Sorry for missing your question Michael, currently you can change the style or remove the highlight by setting highlightOptions on the view. Be aware though that these are set globally. We want to change this behavior for the future but we're still in the design phase. Could you give us more info on why do you want to change it? Is it because of the color, or does is it obscure the original object too much? That would help us to design the new behavior.

If it's just about the bug you mentioned where the graphic becomes invisible but it still keeps the highlight, then we fixed that for 4.14. 

0 Kudos
MichaelDenholtz
New Contributor II

Thanks Raluca and Undral for the responses.

I'm trying to draw a rectangle on a scene view that has a top and bottom that are parallel to the equator. The SketchViewModel draws rectangles which are at an angle that seems to depend on the camera view. So, my hacky workaround is to hide the graphic being created by the SketchViewModel, capture the extent of the hidden graphic, and use that extent to draw my own graphic with geometry based on that extent, which looks something like this:

        var polygon = {
            type: 'polygon'
            rings: [
                [xminymin],
                [xmaxymin],
                [xmaxymax],
                [xminymax],
                [xminymin]
            ]
        };

Because the SketchViewModel draws rectangles at an angle I'm able to draw more precisely by capturing the extent of a hidden polyline. Unfortunately, even when the polyline itself is hidden I can still see the highlight effect around the segment that is currently being drawn. In this pen I've configured the polyline symbol layers and highlight effects to be transparent but the "Draw a route" option still has a faint blue hightlight effect for the current segment.

0 Kudos