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.

Add Attachments to New Features

Users are not able to add an attachment to a feature until after a feature has been created and synced with the server. If an editable layer includes a field for a file attachment, the user must create the feature, then re-select the feature using the Edit Feature action to upload attachments.

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.

© 2018 Latitude Geographics Group Ltd. All Rights Reserved.

Documentation Version 4.9