I have an array of arrays which looks like this:
var data = [
[
-9814184.757,
5130582.574600004
],
[
-9814152.5879,
5130624.636799999
],
[
-9814147.7353,
5130632.882600002
]
]
Now when I try to map it into an object like
for (i = 0; i < data.length; ++i) {
for (b = 0; b < 1; ++b) {
var point = new Point(data[i][b],data[i][b]);
}
}
console.log(point);
I am getting undefined for x and y in the object
{type: "point", x: undefined, y: undefined, spatialReference: {…}}
What am I doing wrong?
new Point?xas well asyproperties.. Remove the inner for-loop and passdata[i][0]/data[i][1]tox/y. Also it would be helpful if you would show us howPoint()is implemented