Select to view content in your preferred language

Feature.applyedits(update) where can I get Unique ID of Graphics?

2973
5
10-14-2015 05:31 AM
GianniContino
Occasional Contributor
I have a featureLayer from a server arcgis 10.2.2.
I have to update a Graphic from the layer, and I need the unique ID in order to pick the graphic by getGraphic (id).
Where is stored the ID to pass to method?
Thanx
0 Kudos
5 Replies
EricBader
Honored Contributor

Hi Gianni,

It depends on what you are really trying to do. Are you really trying to update the feature in the feature layer? Or are you really working with graphic elements in a GraphicsLayer?

If you are really trying to update the geometry of a feature in a feature layer, you may want to use the editing tools in the toolkit. You can find an example of how to do this here: Online editing | ArcGIS for Developers .

For getting the graphic IDs from a GraphicsLayer, you can call getGraphicIDs() on your GraphicsLayer to get all the IDs, or you can call getGraphicIDs(x,y,pixel_tolerance,number_of_results) to locate a specific graphic.

Hope this helps.

0 Kudos
GianniContino
Occasional Contributor
Hi Eric,
I have another problem.
I hope you are able to help me.
I have a FeatureLayer from an URL of service on ArcGIS Server.
I'm able to create new feature by applyEdits method, but NOT TO UPDATE GEOMETRY of existing feature by the same method.
In fact the method myFeatureLayer.isAllowGeometryUpdates () give me FALSE.
Where can I set this capability in the layer manager of server?
Feature Service is enabled to Create, Query,  Delete, Update but in java sdk the geometry doesn't change.
Thanks
Gianni
0 Kudos
EricBader
Honored Contributor

This property gets applied (true or false) when you configure properties for the FeatureService. You can read more about how to do this here Editor permissions for feature services—Documentation (10.3 and 10.3.1) | ArcGIS for Server

If right now this is reporting FALSE, this means it was set as FALSE when the FeatureService was initially created.

Hope this helps!

0 Kudos
GianniContino
Occasional Contributor
Thanks a lot, Eric. But I still haven't solved the issue.
when I published the layer i did check the flags on Allow Geometry Updates, but from java application the method isAllowGeometryUpdates() continues to return false and I can't update geometries.
I read that this method is deprecated. Maybe i should use canUpdateGeometry() instead but it is only to check the capability and i should have always the problem.
What about for you?
0 Kudos
EricBader
Honored Contributor

That is strange.

How did you publish the feature service? From ArcMap?

Where is the data coming from for your feature service?

0 Kudos