arcgis-rest-js icon indicating copy to clipboard operation
arcgis-rest-js copied to clipboard

why does "applyEdits" doesn't get x,y coordinates as exampled

Open arielhasidim opened this issue 4 years ago • 3 comments

Hello, On all of the official examples here: 1, 2 and 3, applyEdits gets geometry like this:

geometry: { x: -120, y: 45, spatialReference: { wkid: 4326 } }

or just

geometry: { x: -120, y: 45 }

But when I try to pass in the example I get this error: Screen Shot 2021-11-09 at 10 43 10

When I check, applyEdits gets IFeature, and IFeature geometry gets IGeometry which defined like this:

export interface IGeometry {
    spatialReference?: ISpatialReference;
}

And ISpatialReference defined like this:

export interface ISpatialReference {
    wkid?: number;
    latestWkid?: number;
    vcsWkid?: number;
    latestVcsWkid?: number;
    wkt?: string;
    latestWkt?: string;
}

Shouldn't IFeature get geometry as an IPoint??

It's defined like this:

export interface IPoint extends IHasZM, IGeometry {
    x: number;
    y: number;
    z?: number;
}

arielhasidim avatar Nov 09 '21 08:11 arielhasidim

Hey @gavinr.

IFeature[geometry] does have a type issue. It needs to be a list of geometry types and not the shared IGeometry.

I won't PR b/c of the all the work going on.

It you want to fix it, it's a pretty simple.

Here's my branch and associated commit.

COV-GIS avatar Nov 10 '21 00:11 COV-GIS

Hey @gavinr.

IFeature[geometry] does have a type issue. It needs to be a list of geometry types and not the shared IGeometry.

I won't PR b/c of the all the work going on.

It you want to fix it, it's a pretty simple.

Here's my branch and associated commit.

Look's great. Why not PR this AS IS?

I can fork, commit and PR if you would like (I want it to be included in the official pkg for use in firebase-cloud functions).

arielhasidim avatar Nov 10 '21 09:11 arielhasidim

fc64c99d434ed812c2c09849828a8beec8f106ae looks good to me, thanks @COV-GIS. If you want to PR, that's fine, we can merge it upstream with our many version v4 changes.

gavinr avatar Nov 10 '21 20:11 gavinr

We got this in to the v4 branch in #1010. Closing. If there's still an issue after the next release, please let us know. Thanks again @COV-GIS

gavinr avatar Sep 01 '22 16:09 gavinr