js api 4.* how to create 3 d polygon whose points are in touch with scene and not float in air

589
1
Jump to solution
10-22-2023 05:46 AM
MichaelLev
Occasional Contributor III

my scene is 3d containing buildings etc.

I want to create polygon that its points will "stick" to the 3D scene and not "float" in the air.

When I edit the polygon, I also want that its points will "stick" to the 3D scene and not "float" in the air.

0 Kudos
1 Solution

Accepted Solutions
MichaelLev
Occasional Contributor III

I solved it -

1. I display the polygons via a graphic layer whose elevationInfo property you'll set to "on-the-ground".

2. I use SketchViewModel whose layer property is that graphic layer, and whose  defaultUpdateOptions property is:

    defaultUpdateOptions: {
        tool: "reshape",
        enableRotation: false,
        enableMoveAllGraphics: false,
        enableScaling: false,
        reshapeOptions: {
            shapeOperation: "none"
        },
        toggleToolOnClick: false
    }

View solution in original post

0 Kudos
1 Reply
MichaelLev
Occasional Contributor III

I solved it -

1. I display the polygons via a graphic layer whose elevationInfo property you'll set to "on-the-ground".

2. I use SketchViewModel whose layer property is that graphic layer, and whose  defaultUpdateOptions property is:

    defaultUpdateOptions: {
        tool: "reshape",
        enableRotation: false,
        enableMoveAllGraphics: false,
        enableScaling: false,
        reshapeOptions: {
            shapeOperation: "none"
        },
        toggleToolOnClick: false
    }

0 Kudos