Unable to cut Polygon in arcgis javascript

2028
7
Jump to solution
10-19-2018 05:19 AM
vikaswardiya
New Contributor II

Hi,

I have one Polygon feature Layer in web page. now i want to perform cut operation with geometryEngine.cut method in dojo JavaScript. This is what i have done.

1 I add feature layer into the map.

Adding FeatureLayer to the map

2 I took geometry on   event into a  polygongeometry1 variable.Taking Geometry of a selected Polygon into a polygongeometry1 varialbe

3 Then I draw a polyline with a draw widget and took its geometry into a linee variable. and pass it to a geometryEngine.cut method . but i receive this error

ge_version error

cannot read Property _geVersion of undefined although both polygon and line geometries are there.

Actually I want to cut a Polygon shape file temporarily and undo it.#cut polygon.

I have no Idea what is wrong with it. Kindly help..

1 Solution

Accepted Solutions
KristianEkenes
Esri Regular Contributor

Yes. Be sure you are using a Polyline and a Polygon geometry for your inputs instead of graphics. The geometryEngine only works with geometries.

View solution in original post

7 Replies
RobertScheitlin__GISP
MVP Emeritus

Vikas,

   From your text and image it looks like you are passing the graphic and not the graphics geometry.

KristianEkenes
Esri Regular Contributor

Yes. Be sure you are using a Polyline and a Polygon geometry for your inputs instead of graphics. The geometryEngine only works with geometries.

vikaswardiya
New Contributor II

Hi sir,

I passed geometry and it worked fine. but I want to cut the feature layer but i am getting a geometry in return to cut operation. how can i update the feature layer with this result. also i want to undo the cut operation. 

this is what i got.

0 Kudos
vikaswardiya
New Contributor II

Thank you sir, I figure out my problem. actually i was using wrong geometry. Now I am able to edit feature layer also.

Thanks for your help.

0 Kudos
vikaswardiya
New Contributor II

Thank you sir, I figure out my problem. actually i was using wrong geometry. Now I am able to edit feature layer also.

Thanks for your help.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos
AndyWhitaker1
New Contributor III

I was seeing this same error when trying a geometry contains function, with a Polyline, and what I thought was a Point (it wasn't).  Once I created a new Point from the generic Object, it worked.  It would be nice if the error message could lead a consumer of the API down a path to solving the issue.  Instead, it's so vague, that we have to ask in a developer forum.

0 Kudos