Editing and Snapping in Silverlight

2940
8
10-20-2010 01:17 PM
JoshV
by
Occasional Contributor
I'm simply looking for a way or possibly a template that allows for editing a feature layers geometry and snapping it to another layer.  I've been looking on resources.arcgis.com but any advice is appreciated.

Thanks
0 Kudos
8 Replies
JenniferNery
Esri Regular Contributor
Sure, you can look at this sample: http://help.arcgis.com/en/webapi/silverlight/2.1/samples/start.htm#EditToolsAutoSave

Notice that the map has attached properties SnapKey and SnapDistance, the Editor uses this. If you activate the EditVertices button, key down on S while moving a vertex, it will snap to other vertices on another feature other than itself.

If SnapKey or SnapDistance is not set, they get default by values (Ctrl, 15) as in the EditorWidget sample in our SDK http://help.arcgis.com/en/webapi/silverlight/2.1/samples/start.htm#ToolkitEditorWidget.
0 Kudos
JoshV
by
Occasional Contributor
Sure, you can look at this sample: http://help.arcgis.com/en/webapi/silverlight/2.1/samples/start.htm#EditToolsAutoSave

Notice that the map has attached properties SnapKey and SnapDistance, the Editor uses this. If you activate the EditVertices button, key down on S while moving a vertex, it will snap to other vertices on another feature other than itself.

If SnapKey or SnapDistance is not set, they get default by values (Ctrl, 15) as in the EditorWidget sample in our SDK http://help.arcgis.com/en/webapi/silverlight/2.1/samples/start.htm#ToolkitEditorWidget.



Hi Jennifer, just to verify..  In order for me to duplicate what is in that sample link, I will need ArcGIS Server 10, I assume the latest and greatest Silverlight (version 4.0 maybe?), and Visual Studio 2010?  Did I miss anything?  There is no chance I can duplicate the snapping in an editing environment just using Visual studio 2008 with ArcGIS Server 10 and Silverlight 4.0 is there?

My last question is I notice in the XAML the "Editable Layer" is classified as a "FeatureLayer" but what extra steps do I need to take to make a layer (a layer from my map service from my mxd) an "Editable Layer" besides just declaring it a FeatureLayer in my XAML?

Thank you so much for the insight Jennifer..

-Josh
0 Kudos
JenniferNery
Esri Regular Contributor
The Editor supports GraphicsLayer too.  If you choose to use FeatureLayer, you will need an editable feature service. I'm not sure what other MXD settings are necessary. You can probably check the feature service in the sample and view it in the browser to get an idea of what it would look like.

Yes you will need at least ArcGIS API for SL/WPF v2.0, but there were bug fixes in v2.1 regarding Snapping.  If you can use v2.1 beta, RC is coming up soon.  You will then need ArcGIS Server 10 and also SL 4.  As far as SL4 and VS 2008 compatibility, here's a link to MS forum http://forums.silverlight.net/forums/p/178873/402929.aspx. We use VS 2010 though.
0 Kudos
JoshV
by
Occasional Contributor
The Editor supports GraphicsLayer too.  If you choose to use FeatureLayer, you will need an editable feature service. I'm not sure what other MXD settings are necessary. You can probably check the feature service in the sample and view it in the browser to get an idea of what it would look like.

Yes you will need at least ArcGIS API for SL/WPF v2.0, but there were bug fixes in v2.1 regarding Snapping.  If you can use v2.1 beta, RC is coming up soon.  You will then need ArcGIS Server 10 and also SL 4.  As far as SL4 and VS 2008 compatibility, here's a link to MS forum http://forums.silverlight.net/forums/p/178873/402929.aspx. We use VS 2010 though.


Cool Jennifer.. Do you have any links or documentation on what is involved on an "Editable feature Service"?  I just need to know the ends and outs of making a Layer in my Web Application editable.  Will I be able to do multi-user editing?

Many thanks Jennifer
0 Kudos
JenniferNery
Esri Regular Contributor
Maybe this? http://help.arcgis.com/en/arcims/10.0/mainhelp/topics/admin_publishing.htm

I have not created a any service on my own, sorry I can't help there.

This might help too http://help.arcgis.com/EN/arcgisserver/10.0/apis/rest/index.html
0 Kudos
JoshV
by
Occasional Contributor
Maybe this? http://help.arcgis.com/en/arcims/10.0/mainhelp/topics/admin_publishing.htm

I have not created a any service on my own, sorry I can't help there.

This might help too http://help.arcgis.com/EN/arcgisserver/10.0/apis/rest/index.html



Hi Jennifer-  I took your suggestion and looked at the REST URL for the FeatureLayer used in that example you posted and can see is in a "FeatureServer Service" and the Evacuation Perimeter layer is of type "Feature Layer" and has operation properties of "Add Features, Update Features, Delete Features, and Apply Edits"

So do you happen to know how I can create a service like that?  I assume I could publish a service like this from ArcCatalog?  I'm having a difficult time tracking documentation on this for some reason.
0 Kudos
JenniferNery
Esri Regular Contributor
I know, I had trouble finding resource too. After asking the experts, this for sure is what you need:
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000021...
0 Kudos
JoshV
by
Occasional Contributor
I know, I had trouble finding resource too. After asking the experts, this for sure is what you need:
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000021...


Thanks Jennifer, that helps a lot.
0 Kudos