Open topic with navigation
Internet Explorer 11 and Microsoft Edge do not support snapping when editing point markup or features.
The Snapping Module provides snapping capabilities to various tools that work with geometries. When enabled, snapping allows the user to precisely draw shapes on the map by snapping to the nearest point, vertex or edge of an existing shape within a configurable radius around the mouse pointer. The user may enable or disable snapping by either clicking the Enable Snapping toggle button, or pressing the keyboard shortcut, which is F by default. The user may choose which layers are affected by snapping by clicking the Select Snapping Layers button.
For the keyboard shortcut to enable or disable snapping to work, the mouse pointer must be over the map.
The snapping feature snaps to the nearest point, vertex or edge to the mouse pointer in that order. For example, if snapping is enabled and a point feature, a vertex, and an edge are similarly near the mouse pointer, the application will snap to the point feature. Similarly, if there is only a vertex and an edge near the mouse pointer, the application will snap to the vertex.
The following tools support snapping: Measure, Draw, Edit, Create New Feature, and non-dragging Identify tools. The snapping controls are configured within both the TabbedToolbar and CompactToolbar modules in the context-sensitive toolbars associated with the following states:
Snapping is only available for the Desktop interface; the Tablet and Handheld interfaces do not support snapping.
To configure which layers may be snapped to and which layers snapping applies to by default, edit the layer in Geocortex Essentials Manager and configure the Allow Snapping and Snapping Enabled settings. For more information, see Layer Settings.
The easiest way to configure snapping for the Measure, Draw, Edit, Create New Feature, and non-dragging Identify tools is to edit your viewer in Geocortex Essentials Manager, navigate to the Toolbar section, and ensure these tools are added along with MeasurementToolControlRegion, MarkupEditRegion, EditControlRegion, CreateNewFeatureControlRegion, or FindDataControlRegion, respectively.
threshold: The pixel radius around the mouse pointer where snapping occurs when enabled. The default is
radiusFillColor: The color of the area around the mouse pointer where snapping occurs when enabled. You can specify either a web color name or hexadecimal value. The default is
radiusFillOpacity: The opacity of the area around the mouse pointer where snapping occurs when enabled. The maximum is
1 (completely opaque), and the minimum is
0 (completely transparent). The default is
radiusBorderColor: The border color of the area around the mouse pointer where snapping occurs when enabled. You can specify either a web color name or hexadecimal value. The default is
radiusBorderSize: The border size, in pixels, of the area around the mouse pointer where snapping occurs when enabled. The default is
pointColor: The color of the point where the next vertex is to be placed. You can specify either a web color name or hexadecimal value. The default is
pointSize: The size of the point, in pixels, where the next vertex is to be placed. The default is
70, which is the F key.
supportedDrawModes: An array of the draw modes to support snapping. By default, they are
snappingProvider: A snapping provider with the following properties:
graphicsLayers: An array of graphic layers used by the snapping feature. By default, they are:
behaviors: An array of named behaviors that run when an associated event occurs. By default, the behaviors are:
SelectLayersForSnappingActivatedBehavior: A behavior that runs an array of commands when the user clicks the Select Snapping Layers button. By default, this the
SelectLayersForSnappingDeactivatedBehavior: A behavior that runs an array of commands when Snappable Layers panel is dismissed by a toggle button. By default, this includes the a single command:
You can remove or rearrange the commands of any behavior. You can also remove behaviors altogether.
You can add commands to a behavior if the command does not require a parameter, or if the type of the command's parameter matches the parameter of an existing command or the event associated with the behavior. Refer to "Viewer Commands and Events" in Developer Help to determine if the parameters are compatible. Note that private commands and events are not documented.
Adding a new behavior is only recommended for experienced developers.
See Viewer Commands and Events for more information.