6.12. Adding Web Maps
There could be several Web Maps in NextGIS Web. For example one map is for work, another is for public access and third is for testing of layer styles.
Each Web Map has its own URL address. Different access permissions for Web Map viewing can be set for users and groups.
Web Map displays layers. They can be turned on or off by the user. You can set the order of the layers, default layer visibility and create layer groups. Groups on a map do not relate to resource groups in the Control Panel. There is no option to transfer layers between groups. Groups may be nested.
6.12.1. Creating a Web Map
To create a Web Map, open the resource group where you want to add it, press Create resource button and in the pop-up window select “Web Map”. (see Pic. 6.179.).
Create resource dialog for a Web Map will open, see Pic. 6.180..
Enter Web Map display name that will be visible in the administrator interface and in the Web Map viewer. (You can set up a title to be displayed in Web Map viewer in the Settings tab.)
“Keyname” field is optional.
You can also add resource description and metadata on the corresponding tabs.
If you want to create a copy of an existing Web Map, you can clone it.
6.12.2. Web Map Layers
In the “Layers” tab you can add, group or remove layers and change their order using the buttons “Add layer”, “Add group”, “Customize draw order” and “Delete layer” (X at the end of each row).
To view the data of the layer on a map, you need to create at least one layer style. More on creating styles for different layer types here.
Layers of a particular map have several settings, see Pic. 6.183..
“Enabled” checkbox sets default visibility of a layer.
The “Transparency” field sets the layer transparency on a map between 0% (opaque) and 100% (completely transparent).
We recommend setting the “Adapter” field to “Image” (a single image for the entire map), unless there are some special requirements. Alternatively, you can choose “Tiles” (images of 256 x 256 pixels).
You can also set up a scale range. Min scale corresponds to the smaller image, max scale - to the larger, more detailed image. For example, if you want a layer to be displayed in scales between 1 : 250,000 and 1 : 5,000, the higher number (250,000) is the minimal scale.
Note
Max and min scale can be set not only using the Web Map’s Layers tab, but also in the layer style itself (See an example). If the layer should not be displayed in a certain range of scales, we recommend to mark it in the Web Map’s layer settings. If the scale limit is only set within the style, empty tiles will be generated in other scales, which is less efficient.
To go back to the layer list, press Hide details.
6.12.2.1. Layer groups
Layers added to Web Map can be gathered into groups. It will only affect the layer tree displayed on the map itself, making the legend more legible. It does not affect the actual resource group contents.
To add a new group press + Group. To put a layer into a group, drag and drop.
Expanded option defines the way the layer group is presented in the layer tree when the Web Map is opened.
If Exclusive is ticked, layers in the group will only be displayed one at a time. If you activate a layer, all other layers of the group are automatically hidden. It can be handy if you have, for example, a group of satellite data that completely overlaps.
To go back to the layer list, press Hide details.
6.12.2.2. Layer draw order
The order of the layers on a map can be different from the order in which they appear in the tree. Click “Customize draw order” in the “Layers” tab of the map settings. It allows to choose the order of the displayed layers without affecting the groups.
To go back to the list of layers, press Back to layers and groups. To restore the initial layer order, press Use default draw order.
Press Save to save the changes.
6.12.3. Basemaps
“Basemaps” tab allows to add and remove basemaps using corresponding buttons “Add” and “Remove” (see Pic. 6.187.).
If “Default basemap” is checked, this basemap will be visible when the Web Map is opened.
“Opacity” field sets basemap transparency on a map in a range between 0 and 100%.
6.12.4. Web Map with no basemap
By default a Web Map is created with OpenStreetMap basemap. If you need a map without a basemap: create a new basemap and add it to your Web Map. Then turn this newly created basemap off.
6.12.5. Settings
In the “Settings” tab you can modify several parameters:
title that will be displayed on the Web Map instead of resource name;
legend visibility (more here);
enable annotations (more on annotations see here);
select measurement spacial reference system;
allow layer editing;
set up initial and constraining extent (see below);
select bookmark resource.
6.12.6. Extent
In the Settings tab you can set up:
Initial extent - part of the Web Map that is shown upon its opening
Constraining extent - users will not be able to zoom out or scroll past this extent
Use the four fields to set the extent measured in degrees.
Extent from layer button allows to set Web Map extent from the layer’s extent. Click it to open the “Select layer” window, where you can select a layer to use for setting the Web Map extent (see Pic. 6.190.). The four fields for the extent coordinates will be filled in.
Tip
Extent coordinates could be generated using third-party services, for example http://boundingbox.klokantech.com/ (select csv in a list).
6.12.7. Bookmarks
In the “Bookmark resource” field of the Settings tab you can select a vector layer with any type of geometry to use for bookmarks. The Web Map will show bookmarks panel (see Pic. 6.191.) with names defined by “Label attribute” if it is set (see Pic. 6.192.).
6.12.9. Final steps
After creating the map content and adjusting settings for all the layers, click “Save” button. A saved map will be shown in the list of maps. Click an icon with a map in the list of Web Maps or select “Display” action in the tab on the Web Map properties page to open it in the viewer. While the Web Map resource page is open, you can also open the map by clicking the “View” button on the right. Web Maps viewer is described here. A Web Map URL displayed in the viewer may be shared with other users because it is static.
Warning
After a map is deleted, its URL will no longer be available.
6.12.8. Social
The “Social” tab is used to upload an image to be used as preview in social media.
Pic. 6.193. “Social” tab