Editing features
ArcGIS Viewer for Silverlight provides a simple and intuitive experience for editing features, including changing their geometries and attributes, adding attachments, and creating and deleting them. Editing is available for layers within ArcGIS Server dynamic map services and Spatial Data Service layers (feature layers) if the service was published with feature access enabled. For more information, see Layer types and Publishing feature services.
Once a feature layer has been added to ArcGIS Viewer for Silverlight, editing an existing feature can be done by clicking the feature to display its pop-up. The pop-up includes buttons to add attachments, change the feature's values, edit its geometry, and delete it. See Pop-ups for more information. If your users need to be able to add new features, enable and the Add Features panel included with ArcGIS Viewer for Silverlight. With the Add Features panel, users can create features by selecting the type of feature they wish to add and drawing it on the map.
For additional information, see Editing features in the ArcGIS API for Silverlight Help and Authoring feature services in the ArcGIS Server Help.
Configuring editing
Editing for feature layers is not enabled by default in the ArcGIS Viewer for Silverlight. This ensures that only the desired layers can be edited by your users. You can choose which layers can be edited, as well as other editing options, as follows:
- Click the Configure button on the Tools tab of the Application Builder toolbar.
- In the Configure Controls dialog box, click the Editng link to open the Configure Editing dialog box.
- In the Configure Editing dialog box, select the layers to edit. Only layers that support editing will be shown here. If you select the option to edit all feature layers, editing will automatically be enabled on any layers added to the map which support editing.Note:
Editing cannot be enabled for layers that have clustering applied. If you attempt to enable editing on a clustered layer, you will be prompted to turn off clustering.
- Click Next to show the editing options.
- Check the box next to any of the editing options you want to enable, then click OK to close the Configure Editing dialog box.Note:
The Advanced Editing Tools section contains tools intended for power users with advanced editing scenarios. When enabled, these appear on a toolbar at the bottom of the the Add Features panel.
Once you have specified the layers to edit, the pop-ups for those layers will include the following editing tools:
- Delete Feature—Click the Delete Feature button to remove the feature from the layer.
- Edit Shape—For point features, click the Edit Shape button, then click and drag the feature to the desired location. For line and polygon features, click the Edit Shape button, then either use the handles on the bounding box to scale, rotate, and move the shape or click and drag on vertices to move the vertices of the shape.
- Edit Values—Click the Edit Values button to edit the feature's attributes. Once you have specified attributes as desired, click Apply. To exit without changing any attributes, click the Cancel button or close the pop-up.
- Add Attachments—Click the Add Attachments button to launch the Open dialog box where you can select the desired attachment. Note:
Layers that support editing do not necessarily support attachments. In order to support attachments, the dataset on the server must first be configured to do so. For more information, see Enabling attachments.
Tip:Which editing tools appear depends on the settings of the feature service and the identity of the logged in user. For example, it is possible to restrict editing operations to the user that created the feature, or to disable certain editing operations altogether. The Viewer will automatically respect the service's configuration.
Adding new features
If your users need to be able to create new features, add the Editing tool to a Viewer toolbar (see Adding and managing tools and toolbars for information). The Editing tool opens the Add Features panel, which displays the types of features that can be created.
You can create features using the Add Features panel as follows:
- Configure editing using the steps in the Configuring editing section of this topic.
- Click the Editing tool you added to the Viewer toolbar. The Add Features panel appears.
- The types of features you can create are displayed in the Add Features panel. If you do not see types for a layer that you wish to edit, ensure that editing is enabled for that layer. You can click Configure Editing at the bottom of the Add Features panel to check this.
- Click the type of feature you wish to add.
- Draw the feature on the map. If you are adding a point feature, simply click once on the map to draw the feature. If you are adding a line or polygon feature, single-click to add vertices, then double-click to complete the feature.
- Once you are done drawing the feature, its pop-up will open so that you can edit the feature's attributes. Simply type the desired values or select them from the drop-down menus and date pickers that appear.
- Click the Apply button to save the feature.
If editor tracking is enabled on the service being edited, the Viewer will automatically record the identity of users who create or edit features. Note that this functionality can only be managed on the service itself; it cannot be enabled or disabled from within the Viewer.