I'm trying to capture the lat/long points of the geometry object belonging to a graphic drawn using the Sketch widget. This is saved along with the various other attributes needed so I can recreate a graphic later that was drawn by one of my users.
However I seem to be getting invalid coordinate values from all the graphics objects created using Sketch.
Below is an example of the 'paths' attribute of a polyline geometry object belonging to a graphic created by Sketch when I log it in console:
path: [[3705938.9073652048, 7757323.750164009], [6425874.121864194, 5957078.859992016]]
Those values don't look right to me since afaik coordinate values can only be a maximum of +/-180 for lat and +/-90 for long. Sure enough when I save those in the database and try to recreate the Graphics later using those values they don't appear, but entering something more sane as coordinates does work such as
path: [60.44300476667183, 62.70164927848015], [48.604437825842, 72.97478588000511]
I've tried simply moving the decimal point down 5 or so spaces but then I get completely inaccurate placement and it doesn't seem like the right thing to do anyway. The coordinate seem like something more than just incorrect decimal placement has happened
Below is a snippet of the code I have where the graphic is captured from the event
sketch.on("create", event => {
if (event.state === "complete") {
let graphic = event.graphic
console.log(graphic) //
}
}