Editing Module

The Editing Module implements editing of features and related features in the viewer.

The Editing Module depends on the FeatureLayer Module, which implements feature layers in the HTML5 viewer. It also works with the Offline Module to support offline editing. In order for features to be editable, they must belong to a feature layer that has editing turned on.

The Editing Module has different views for the different parts of the viewer that provide access to feature editing: MapDataMenuView, TemplatePickerView, EditorView, EditLogView, CreateOrEditView, and MultiFeatureSelectorView.

The Editing Module has the following view models: TemplatePickerViewModel, EditLogViewModel, CreateOrEditViewModel, EditorViewModel, and EditingMapDataMenuViewModel.

Create Point Features Using Geolocation

As of HTML5 Viewer 2.5, users can create point features by using geolocation. To enable this feature, edit your viewer in Essentials Manager, and in the Toolbar section, ensure both Create New Feature and CreateNewFeatureControlRegion are included in your configured toolbar. You can configure geolocation settings with the Geolocate module. For information see Geolocate Module.

When the user selects a point feature template, a menu appears that offers geolocation. If the geolocation result is not within a configurable accuracy threshold, the user is prompted whether to use the result or select a different location on the map. The accuracy threshold is specified in the context-sensitive toolbar that is associated with the Geolocate module's FeaturePlacementPointGraphicState by configuring a accuracyThreshold property. You may also specify the number of milliseconds for which to refine the geolocation reading by configuring a timeLimit property.

Alternatively, you can specify a geolocation profile by configuring a profile property in the Geolocate Module. The geolocation profiles are defined in the GeolocateViewModel by the singleGeolocationProfiles array. The CreateNewFeatureControlRegion also includes snapping tools. In the case of the compact toolbar, do not include the region.

Feature Attachments

Users can add and delete file attachments from a feature at any time.

To add an attachment to a feature:

  1. Click the feature to which you want to add an attachment.

    A map tip for the feature appears.

  2. Click the Edit Feature.

    The View/Edit Attributes panel opens.

  3. In the Manage Attachments section, click Add Attachments.

    The File Upload window appears.

  4. Select the file to upload and click Open.

    The file to upload is added to the list of attachments.

    The file will not be uploaded until you click Save in the next step.

  5. Click Save.

    The file is uploaded.

    If you receive a Forbidden error message, check your proxy settings.

To delete an attachment from a feature:

  1. Click the feature to which you want to add an attachment.

    A map tip for the feature appears.

  2. Click the Edit Feature.

    The View/Edit Attributes panel opens.

  3. In the Manage Attachments section, click beside the attachment you want to delete.

    An alert appears informing you the file will not be deleted until you click Save.

  4. Click OK.

    The alert is dismissed and the file to delete is removed from the list of attachments.

  5. Click Save.

    The file is deleted.

Configuration Properties

Module

Views

View Models

Example - Add a Command with a Parameter to a Behavior

The following example demonstrates adding a new command with a parameter to the behavior, EditorFeatureSelectedBehavior.

To add a command with a parameter to a behavior:

  1. Run an XML editor or text editor as an administrator.

  2. Open one of the viewer configuration files, Desktop.json.js, Tablet.json.js, or Handheld.json.js, in the editor.

    By default, the configuration files are here:

    C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\[instance]\REST Elements\Sites\[site]\Viewers\[viewer]\VirtualDirectory\Resources\Config\Default\

  3. In the Editing module section, find the behaviors property. Locate the behavior you want to edit, for example, EditorFeatureSelectedBehavior.

    {
        "moduleName": "Editing",
        ...
        "configuration": {
            "behaviors": [
                {   
                    "name": "EditorFeatureSelectedBehavior",
                    "commands": [
                        "ZoomToFeature",
                        "SetActiveHighlightLayerDefault",
                        "ClearHighlights",
                        "HighlightFeature"
                    ]
                },
                ...
            ]
        },
        ...
    }

    The behavior executes a few commands, some that include a parameter, for example, ZoomToFeature.

  4. Refer to Viewer Commands and Events to determine the type of parameter that is associated with these commands. ZoomToFeature has a parameter of type, geocortex.essentialsHtmlViewer.mapping.infrastructure.Feature.

  5. Find a command that you want to add to the behavior that has the same parameter type, for example, ShowMapTip.

  6. Add the desired command to the list of commands, separated by a comma. For example:

    "commands": [
        "ZoomToFeature",
        "SetActiveHighlightLayerDefault",
        "ClearHighlights",
        "HighlightFeature",
        "ShowMapTip"
    ]
  7. Save the file.