SketchViewModel New Point Bug?

602
4
Jump to solution
02-01-2022 12:55 PM
ararana
New Contributor

I'm running into an unusual issue when using the SketchViewModel to edit existing polylines, specifically when adding a new points. 

I've been able to narrow the issue down to including Z value elevation to the Paths array of the polyline. When the Z value is provided, I click on a line to put it in edit mode, then I click (hold and drag) a new point in the line and the newly created point jump significantly off into the distance:

ararana_2-1643748866603.png

ararana_0-1643749732631.png

Click, hold, and drag

ararana_0-1643748406151.png

Here's a CodePen demo of the issue.

 

However, if I exclude the Z value elevation from the Paths array of the polyline, I have no issue clicking the new point symbol to create a new point in the line. Again, to reproduce the issue you have to click, hold, and drag the new point symbol. 

ararana_1-1643748823973.png

ararana_0-1643749162968.png

 

Here's a CodePen demo of it working without Z value elevation.

 

Has anyone ran into this issue before? Is there a way I can include point elevation and avoid this issue of the new point jumping out into the distance?

 

Thanks for any help!

0 Kudos
1 Solution

Accepted Solutions
JoseBanuelos
Esri Contributor

Hello @ararana ,

I took a look at this and found that if you convert the coordinates in the polyline provided from WGS84 to WebMercator coordinates, I was not able to reproduce this issue with z-values.

Codepen: https://codepen.io/banuelosj/pen/QWOQBwG?editors=1010

- If you use the polyline with WGS coordinates, you will be able to reproduce the issue.

Currently, editing graphics with coordinates in a different spatial reference than the view is not supported. In the sample you provided, the view has a spatial reference of web mercator, but the polyline had coordinates in WGS84.

Thanks,
Jose

View solution in original post

0 Kudos
4 Replies
JoseBanuelos
Esri Contributor

Hello @ararana ,

I took a look at this and found that if you convert the coordinates in the polyline provided from WGS84 to WebMercator coordinates, I was not able to reproduce this issue with z-values.

Codepen: https://codepen.io/banuelosj/pen/QWOQBwG?editors=1010

- If you use the polyline with WGS coordinates, you will be able to reproduce the issue.

Currently, editing graphics with coordinates in a different spatial reference than the view is not supported. In the sample you provided, the view has a spatial reference of web mercator, but the polyline had coordinates in WGS84.

Thanks,
Jose

0 Kudos
ararana
New Contributor

Thanks @JoseBanuelos , converting to WebMercator coordinates resolved the issue. 

Any plans to add support for longitude/latitude coordinates in a future release?

0 Kudos
JoseBanuelos
Esri Contributor

@ararana ,
Lat/Long with wgs84 spatial reference (SR) is already supported. The issue here is the basemap being used has a web mercator SR, therefore the view has a web mercator SR. This is different then the polyline geometries which use the wgs85 SR. In short, yes, this should work if you use a basemap with a wgs84 SR.

0 Kudos
JoseBanuelos
Esri Contributor

@ararana ,
I wanted to provide an update on this. This issue has been resolved in 2D since support for editing and sketching graphics with different spatial reference than the view has recently been added in version 4.23. However, in 3D we still see the problem. This could now  be considered a potential bug since it is now working in 2D. We are looking into this further, but let me know if you have any questions.

Thanks,

Jose