7.9. Edit vector features
You can modify geometries and attributes of vector features via Web interface or in QGIS desktop app.
7.9.1. Allow editing
By default editing of a Web Map is disabled. To allow users to modify the layers of the map, enable editing in the Web Map settings. To find out how to open the “Update resource” dialog, see this chapter.
You can enable or disable editing of all Web Map layers on the “Settings” tab by selecting the corresponding option in the dropdown menu (see Pic. 7.84.).

Pic. 7.84. “Enable layers editing” is turned on
Note
By default layer editing is turned off.
Editing is available for users who have permissions to read and modify data. The “Modify data” permission can be set for the entire resource group where the data is stored or for individual layers.
Users who do not have “Modify data” permission won’t be able to activate the edit mode. How to check user permissions.

Pic. 7.85. Permissions set for the Data resource group to allow editing
7.9.2. Edit mode on a Web Map
Open Web Map and select the layer with the feature you need to edit.
Open dropdown menu by pressing the three dots to the right of the layer name (see Pic. 7.86.), then select “Edit”.

Pic. 7.86. Entering the editing mode
Editing toolbar will appear on the Web Map (see Pic. 7.87.):

Pic. 7.87. Editing toolbar
7.9.3. Create a new feature (point, line, polygon)
On the editing toolbar activate “Create features” button (see Pic. 7.88.):

Pic. 7.88. “Create features” button on the editing toolbar
A blue circle will appear nearby a mouse pointer, with it you can add new features. Click on the map to create a new feature. You can add several new features one after another. While creating a line you need to indicate its start and end points by clicking on the map. While creating a polygon each new click on the map will indicate its new vertice, to finish a polygon you need to click on its start point. You can use adhesion while creating vertices.
In the opened pop-up window you can enter attribute values, then and press Ok to complete feature creation. To clear the form, press Reset.

Pic. 7.89. Entering attribute values for a new feature
You can add multiple features in one go. To create a straight line click on the map to indicate its beginning and end. To create a polygon, click on the map to mark its vertices, then click on the first point to complete the polygon. Snapping is used while adding vertices.
To finish creation of the new feature press “Stop editing” in the layer menu.
In the opened dialog select “Save” to save changes, “Don’t save” to discard them, or “Cancel” to stay in the edit mode:

Pic. 7.90. Dialog window of finishing edits
7.9.4. Delete a feature
On the editing toolbar activate “Delete features” button (see Pic. 7.91.):

Pic. 7.91. “Delete features” button on the editing toolbar
Features you can modify will reduce their color intensity and have a blue outline. The pointer will become a black cross.
Left-click to select the features you would like to delete. Selected features will become dark again.

Pic. 7.92. The layer with the purple points is active. The marked points have been selected to be deleted
Select “Stop editing” in the layer dropdown menu.
In the opened dialog select “Save” (see Pic. 7.90.).
7.9.5. Move a feature or its vertices
On the editing toolbar activate “Modify features” button (pencil icon, see Pic. 7.93.):

Pic. 7.93. “Modify features” button on the editing toolbar
Features you can modify will reduce their color intensity and have a blue outline.
Select a feature (point) or one of its vertices (line, polygon) with the pointer and drag it, then release on a new place. For vertices modifying an adhesion will work.

Pic. 7.94. Moving a point. Before you confirm the edit, both its initial and its final location will be visible on the map
Select “Stop editing” in the layer dropdown menu.
In the opened dialog select “Save” (see Pic. 7.90.).
Note
You can edit several layers simultaneously. To do it enter the edit mode in every layer you want to edit. Adhesion will work for features of all these layers.
7.9.6. Add and delete vertices
To delete a vertice enter the editing mode, hold Shift and click on the vertice.
To add a vertice, click on the line between two existing vertices and drag it to the desired location.

Pic. 7.95. Creating a new vertice
7.9.7. Edit attribute values
NextGIS Web software allows to edit attributes for geographical features. Editing could be launched from the administrator interface or from the map display.
Editing attributes from administrator interface:
Click the table icon opposite the resource or select an action for a vector layer called “Feature table” in the actions pane (see Pic. 7.16.).
A feature table for the layer will open. Select the row you want to edit. It will be highlighted in yellow.
Click Edit button (see Pic. 7.96.).

Pic. 7.96. Editing attributes from administrator interface
Editing attributes from the map display:
Open a Web Map.
Click on the map with Identify tool active.
Click edit button in the Identify window (the last tab, see Pic. 7.97.).

Pic. 7.97. Editing attributes from the map
You can change attribute values in the opened window. Description made on “Description” tab will be visible on the map display in the indentify window.
Editing page has following tabs:
“Attributes” tab (see Pic. 7.98.).

Pic. 7.98. “Attributes” tab
To edit an attribute click on the field.
Numbers can be typed in or modified with errows that appear on the right end of the field.
Dates also can be typed in or selected in the calender. To open the calender click the icon on the right end of the field.
“Description” tab (see Pic. 7.99.).

Pic. 7.99. “Description” tab
“Attachments” tab (see Pic. 7.100.).

Pic. 7.100. “Attachments” tab
Note
When editing a PostGIS layer attribute changes are saved to PostGIS database and descriptions are saved to a local database. When editing a layer based on a Shapefile attribute all changes are saved to a local database.
Note
Geodata with changed attributes could be downloaded by link Download as GeoJSON or published as WFS service. Download of descriptions is currently unavailable.
7.9.8. Attachments
NextGIS Web software supports adding photos, panoramas and other files to the features. If a feature has attachments, they will be shown along with description and attributes in the identify window (see Pic. 7.101.).

Pic. 7.101. Identify window for a feature with attached photos
Files in the following formats can be viewed directly in the web client:
JPEG, PNG images. GIF format not supported.
Panoramas complying with the specification.
Other types of files can be added as attachments, but won’t be viewed in the interface.
After a click on a photo preview a lightbox window is open (a javascript powered window in browser). Photo size is adjusted to fit the window. Photos have descriptions and user can navigate through them using left and right arrow keys on the keyboard (see Pic. 7.102.).

Pic. 7.102. A lightbox with uploaded photo for the identified feature
To navigate within the panorama, use the mouse. Hold down the left mouse button to rotate the camera. Use the wheel to zoom in and out. Panorama mode can be disabled by clicking on the blue round button in the upper right corner.

Pic. 7.103. Panorama opened from Web Map
7.9.8.1. Add attachments to a feature
To add an attachment to a feature, go to the edit window. There are several ways to open it:
Click on the feature on the Web Map, then in the pop-up window press the Edit button.
Open the feature table on the Web Map, select the feature and click Edit in the toolbar.
Open the feature table from the resource page, select the feature and click Edit in the toolbar.
On the Edit page open the Attachments tab and upload the files.

Pic. 7.104. Adding file as attachment
Enter titles for the attachments and press Save.
After uploading you can see previews of photos and panoramas on the “Attachments” tab of the identify window (see attach_tab_pic
).
Note
By default attachments could be added by any user but there is an option to limit number of users who can upload photos (see Managing access rights).
You can edit file names and descriptions of the added attachments. To delete an attachment, press the cross icon to its right. If you’ve made an error during editing, press Reset, all modifications will be cancelled.
To delete an attachment select it on the “Attachments” tab of the edit window, click Delete, and then click Save button.
See the process of adding attachments in our video:
Watch on youtube.
7.9.8.2. How to use panoramas
Not only photos, but also panoramas can be added as attachments. They allow to immerse explore new locations or find new details in familiar places.

Pic. 7.105. Panorama preview in the identify panel
Uploaded panoramic images must comply with the Google XMP Photo Sphere specification.
See how to work with panoramas in our video:
Watch on youtube.
7.9.8.3. Export and import attachments
To copy feature attachments between different layers or to create a backup you can save them to your device as an archive (Standard layer saving does not include attachments).
Navigate to the layer resource page and select Manage attachments.

Pic. 7.106. Managing attachments
To save the attachments, go to the Export tab and press Export attachments to ZIP archive. The resulting ZIP archive will contain all of the attachments put in directories named after feature IDs. Attachment metadata are put into a separate JSON file.

Pic. 7.107. Exporting attachments as ZIP archive
The resulting archive can be imported to add the attachments to the layer features. Open the Import tab, click Import attachments from ZIP archive and select the archive on your device. An archive must contain directories named after feature IDs. Each folder can contain one or many attachments. Duplicates will be ignored. If you need to replace the current attachments, tick “Delete existing attachments”.

Pic. 7.108. Importing attachments from ZIP archive