Unable to transform rectangle using SketchViewModel in SceneView

183
3
Jump to solution
10-21-2021 10:06 AM
avecchi
New Contributor II

Hello,

I am trying to draw a rectangle on a SceneView with SketchViewModel and have it be scaleable as in this example: https://developers.arcgis.com/javascript/latest/sample-code/sketch-geometries/

When I attempt to use the "transform" tool on the graphic in my SceneView, the scaling handles do not appear.

sketchrectangle.gif

On the example, I can transform like this:

sketchrectanglecorrect.gif

Here is the code I'm using:

const graphicsLayer = new modules.GraphicsLayer()

view.map.layers.add(graphicsLayer)

const sketch = new SketchViewModel({ view, layer: graphicsLayer, defaultUpdateOptions: { tool: 'transform' } })

const polygonSymbol = {
  type: 'simple-fill',
  color: [150, 150, 150, 0.2],
  outline: {
    color: [255, 0, 0],
    width: 2
  }
}

sketch.set('polygonSymbol', polygonSymbol)
sketch.create('rectangle', { hasZ: false })

Is there something I'm missing?

0 Kudos
1 Solution

Accepted Solutions
SaschaBrunnerCH
Esri Contributor

@avecchi ,

The "transform" behavior got changed with introducing "Line and polygon transformations" in 4.19 for 3D. This was not possible with 3D before but in 2D. Check also the release notes: https://developers.arcgis.com/javascript/latest/4.19/.
So it looks like you are working with 4.18 or below?

Thanks, 
Sascha

View solution in original post

0 Kudos
3 Replies
JoseBanuelos
Esri Contributor

@avecchi ,

Could you please provide a codepen or something similar to view a test app that reproduces this issue? I was unable to reproduce this with the code you provided and I tested with versions 4.19 - 4.21. What version of the JSAPI are you seeing this, and have you tested with different versions of the API and are able to reproduce as well?

Thanks,

Jose

0 Kudos
SaschaBrunnerCH
Esri Contributor

@avecchi ,

The "transform" behavior got changed with introducing "Line and polygon transformations" in 4.19 for 3D. This was not possible with 3D before but in 2D. Check also the release notes: https://developers.arcgis.com/javascript/latest/4.19/.
So it looks like you are working with 4.18 or below?

Thanks, 
Sascha

View solution in original post

0 Kudos
avecchi
New Contributor II

That was it! Thank you so much!

0 Kudos