Select to view content in your preferred language

Multiple Feature Edits

700
1
03-04-2011 04:37 AM
RobertBrodsky
Deactivated User
Hi;

I am using the Edit Tools - Explicate save example from:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsExplicitSave

The question I have is about this piece of code:
     <esri:Editor x:Key="MyEditor"
                         Map="{Binding ElementName=MyMap}"
                         LayerIDs="ThreatAreas"  
                         GeometryServiceUrl="http://xxxxx/ArcGIS/rest/services/MapServices/Geometry/GeometryServer" />

I have several FeatureLayer I am already loading.

<esri:FeatureLayer ID="EditLayerClass1"
                               Url="http://xxxx/FeatureServer/0"
                               MouseLeftButtonUp="FeatureLayer_MouseLeftButtonUp"
                               MouseLeave="FeatureLayer_MouseLeave"
                               DisableClientCaching="True"
                               Mode="OnDemand"
                               SelectionColor="#FFFFFF00"
                               ValidateEdits="True"
                               OutFields="*" >
                <esri:FeatureLayer.MapTip>
                    <Border BorderBrush="DarkGray" CornerRadius="13" BorderThickness="1"
                </esri:FeatureLayer.MapTip>
            </esri:FeatureLayer>

<esri:FeatureLayer ID="EditLayerClass2"
                               Url="http://xxxx/FeatureServer/1"
                               MouseLeftButtonUp="FeatureLayer_MouseLeftButtonUp"
                               MouseLeave="FeatureLayer_MouseLeave"
                               DisableClientCaching="True"
                               Mode="OnDemand"
                               SelectionColor="#FFFFFF00"
                               ValidateEdits="True"
                               OutFields="*" >
                <esri:FeatureLayer.MapTip>
                </esri:FeatureLayer.MapTip>
            </esri:FeatureLayer>

How could I reference this features using the above code.

Thank you in advance
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor

<esri:Editor x:Key="MyEditor"  
Map="{Binding ElementName=  MyMap}"  
LayerIDs="ThreatAreas" GeometryServiceUrl=  "http://xxxxx/ArcGIS/rest/services/MapServices/Geometry/GeometryServer" /> 


You need to replace the highlighted texts with your map control's name, layer IDs (i.e.: "EditLayerClass1, EditLayerClass2"), and your own Geometry Service URL. Editor.LayerIDs is not required if all GraphicsLayers and editable FeatureLayers in your map will use the same Editor. Setting Editor.Map property should be sufficient in this case. Editor.LayerIDs is often used to specify which layers Editor need to work on.

Note also that Add button will be disabled if its Editor contains more than one layer. In this sample, the same Editor is used because it was working against one layer only. You will need to update the Add button. Where you define another Editor that has only one LayerID and CommandParameter must match a feature type in your service.
      <Button x:Name="AddButton" Margin="2"
                         DataContext={StaticResource EditLayerClass1Editor}
                         ToolTipService.ToolTip="Fire"
                         Content="Add Polygon" 
                         Command="{Binding Add}">
                        <Button.CommandParameter>
                            <sys:Int32>10301</sys:Int32>
                        </Button.CommandParameter>
      </Button>


Alternatively, you can use TemplatePicker for Add. http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitTemplatePicker
0 Kudos