Configuring SWDs to use with Edit Add-In
Databases are used to create, edit and store data in real time. To edit layers inside WebMap, the corresponding database layer should first be configured in the SWD using CadcorpSIS Desktop. This includes defining custom edit properties.
1. Add Overlay
Add the spatial database layer to the SWD. The user must have edit rights enabled for the table.
Locally stored layers should be uploaded first to a database. See also File > Export
2. Define Properties
To use editing, define two specific overlay properties to the SWD: one to allow the Overlay to be used for editing, the second to add an item in the Editing menu on the WebMap page.
- In SIS Desktop 9.1 click Overlays settings (Or right click on an overlay and select properties).
- Select the overlay to be edited in WebMap.
- Select Properties > Add Attribute.
a. Add the WML::AllowWebEditing@ property and set it to True. This makes the layer editable. More than one editable table can be defined in an SWD.
b. Now add the WML::GeometryOptions$ property. This field accepts a JSON string which defines the settings for the editable layer. Here is an example:
{
"icon": "mdi-vector-polygon-variant",
"geometryType": "Polygon",
"textKey": "Planning Application - Snap Overlay",
"displayColumn": "name"
}
If using Polygons, set “geometryType” option to “Polygon” with a capital P (only applicable for OS Mastermap)
When defining Geometry for the first time as a property in SIS Desktop, remember to add it as free text :{"icon": "mdi-vector-polygon-variant","geometryType": "polygon","textKey": "Planning Application - Snap Overlay","displayColumn": "name"}
Once created, you can view it using the JSON editor in SIS Desktop.
Geometry Options
“icon”
Icon displayed next to the layer name. Icons can be selected from https://materialdesignicons.com/ The JSON format for icons is “
mdi-IconName
” where IconName is the icon name listed.
“geometryType”
Denotes the type of geometry that can be created on the layer. Only one geometry type is allowed on each layer and the options are polygon, linestring or point.
If the geometryType is set to Line, Polygon or Point, their multi-geometry versions are also supported. e.g. if you set the geometryType to Line, WebMap will accept Line and MultiLine features to copy.
To set geometryType see WML::GeometryOptions$ property above.
“textkey”
Text prompt that appears in the Editing menu next to the icon. Either free text or a path can be used. The latter will support translation if required. The text key itself is held in \wwwroot\Lang\en-gb.json and can be input as
"textKey": "map.extensions.editing.createPolygon"
.
“displayColumn”
This column will be promoted to the top of the data input menu; it should be set to a valid schema column name. If multiple columns are available, the user can choose which column’s data will be displayed on the map.