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:
Click, hold, and drag
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.
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!
Solved! Go to Solution.
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
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
Thanks @JoseBanuelos , converting to WebMercator coordinates resolved the issue.
Any plans to add support for longitude/latitude coordinates in a future release?
@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.
@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