<a id="ngw-connected-in"></a>

# WFS, WMS, TMS layers

NextGIS Web allows to add data from external sources using standard protocols:

* [WFS](https://docs.nextgis.com/docs_ngweb/source/connections.html#ngw-fws-in),
* [WMS](https://docs.nextgis.com/docs_ngweb/source/connections.html#ngw-wms-in),
* [TMS](https://docs.nextgis.com/docs_ngweb/source/connections.html#ngw-tms-in).

Also, you can make a [layer based on a PostGIS database](https://docs.nextgis.com/docs_ngweb/source/postgis_details.html).

<a id="ngw-wfs-in"></a>

## WFS

[WFS](../../glossary.html.md#term-WFS) allows to get data published on third-party GIS servers (arcgis, geoserver etc), apply custom styles to them and add them to Web Maps.

First you need to create a WFS connection.

<a id="ngw-wfs-connection"></a>

### WFS connection

Click **Create resource** button and select  **WFS connection**.

![image](docs_ngweb/source/_static/ngweb_create_wfs_conn_en.png)

Next you can enter a custom name that will be displayed in the resource list.

![image](docs_ngweb/source/_static/wfs_connection_name_en.png)

Also you can add [Description and metadata](https://docs.nextgis.com/docs_ngweb/source/edit_resource.html#ngw-update-info-metada).

On the “WFS connection” tab enter the parameters that will be used to connect to the **WFS server** providing the data:

* URL
* Username
* Password
* WFS version

![image](docs_ngweb/source/_static/wfs_connection_set_en.png)

If the version you selected is not supported, you’ll get an error message after clicking **Create**:

![image](docs_ngweb/source/_static/wfs_connection_error_en.png)

Next you can create WFS layer resource.

<a id="ngw-wfs-layer"></a>

### WFS Layer

**WFS Layer** is added using an existing WFS connection. Select the resource type in the **Create resource** menu.

![image](docs_ngweb/source/_static/ngweb_create_wfs_layer_en.png)

In the opened window in the “WFS layer” tab select the WFS connection you created. Next select the layer and the geometry field. SRID will be added automatically.

![image](docs_ngweb/source/_static/wfs_layer_settings_en.png)

On the “Resource” tab you can set a custom name for the resource. Also you can add [Description and metadata](https://docs.nextgis.com/docs_ngweb/source/edit_resource.html#ngw-update-info-metada).

To add a WFS layer to a Web Map, you need to create a style for it. You can create a default QGIS style or [a custom QGIS or Mapserver style](https://docs.nextgis.com/docs_ngweb/source/mapstyles.html) using “Create resource” menu.

![image](docs_ngweb/source/_static/wfs_layer_result_en.png)

<a id="ngw-wms-in"></a>

## WMS

#### NOTE
Currently supported WMS versions are 1.1.1 and 1.3.0.

NextGIS Web is a [WMS](../../glossary.html.md#term-WMS) client. To connect a WMS layer you need to know its address and coordinate system. Make sure this SRS is [added to your Web GIS](https://docs.nextgis.com/docs_ngweb/source/ngw_srs.html).

See how to add WMS with local CRS in our video:

<iframe width="560" height="315" src="https://www.youtube.com/embed/dYvOnKSSqBQ?si=l83YINngkAo_dmbq" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Watch on [youtube](https://youtu.be/dYvOnKSSqBQ?si=kXYVFnqFXw3IN3kI).

<a id="ngw-create-wms-connection"></a>

### WMS Connection

To add a WMS layer you need to create a resource called WMS connection. You may create a single connection for many layers. Click **Create resource** button and select  **WMS connection**.

![image](docs_ngweb/source/_static/ngweb_create_wms_conn_en.png)

Enter the name of the resource that will be displayed in the administrator interface. Not to be confused with layer name in a database. “Keyname” field is optional.

![image](docs_ngweb/source/_static/create_wms_connection_name_en.png)

Also you can add [Description and metadata](https://docs.nextgis.com/docs_ngweb/source/edit_resource.html#ngw-update-info-metada).

On the “WMS connection” tab enter the following WMS server connection parameters:

* URL
* Username
* Password
* Version of WMS protocol
* Capabilities (manages GetCapabilities queries to the WMS Server)
* Referer - optional HTTP header field required to access some services
* Skip SSL/TLS certificate verification

URL field needs to be filled, others are used when necessary.

![image](docs_ngweb/source/_static/create_wms_connection_url_en_2.png)

After setting up all necessery parameters, click **Create**.

<a id="ngw-create-layer-wms"></a>

### WMS layer

Now you can add WMS layers. Open the resource group where you want to create the layer. Click **Create resource** button and select **WMS layer**.

![image](docs_ngweb/source/_static/ngweb_create_wms_layer_en.png)

Enter display name that will be visible in administrator interface and in the map layer tree.

![image](docs_ngweb/source/_static/create_wms_layer_name_en.png)

Tile cache settings are described in details [in this section](https://docs.nextgis.com/docs_ngweb/source/mapstyles.html#tile-cache).

Switch to the “WMS layer” tab set up the following parameters:

* WMS connection that was created earlier.
* MIME-type from the dropdown list.
* Select the required layers from the list by clicking the underlined names. You can select several layers.
* Remote SRS - if the server supports serveral SRS, you can pick one from a dropdown list. SRS absent from your Web GIS are displayed in grey. Click **Add to Web GIS** to add the SRS and use it. [More on additional SRS](https://docs.nextgis.com/docs_ngweb/source/ngw_srs.html#custom-spacial-reference-systems). You can check if this coordinate system is available for a particular layer by making a `GetCapabilites` request to a server and examining the response.
* Vendor parameters - optional

![image](docs_ngweb/source/_static/create_wms_layer_parameters_en_3.png)![image](docs_ngweb/source/_static/create_wms_layer_select_res_en.png)

Vendor parameters are special query settings for additional functions. They vary depending on the WMS provider.

![image](docs_ngweb/source/_static/create_wms_layer_vendorparam_en.png)

Also you can add [Description and metadata](https://docs.nextgis.com/docs_ngweb/source/edit_resource.html#ngw-update-info-metada).

After setting up all necessery parameters, click **Create**.

#### WARNING
Identification requests to external WMS layers from Web Maps are not supported yet.

<a id="ngw-tms-in"></a>

## TMS

To add data from external sources using [TMS](../../glossary.html.md#term-TMS) protocol, first create TMS connection.

#### NOTE
Data uploaded to NextGIS Web, can also be [added to external application via TMS](https://docs.nextgis.com/docs_ngweb/source/external.html).

<a id="ngw-create-tms-connection"></a>

### TMS connection

To add a TMS layer, you first need to create a [TMS](../../glossary.html.md#term-TMS) connection. Click on **Create resource** button and select **TMS connection** (see [Fig. 552.](#tms-connection-create)).

![image](docs_ngweb/source/_static/ngweb_create_tms_conn_en.png)

Enter the connection name that will be displayed in the administrator interface (see [Fig. 553.](#tms-connection-name)).

![image](docs_ngweb/source/_static/TMS_connection_name_en_3.png)

Also you can add [Description and metadata](https://docs.nextgis.com/docs_ngweb/source/edit_resource.html#ngw-update-info-metada).

On the TMS connection tab you need to select the way to connect to the TMS server - custom or via NextGIS GeoServices (see [Fig. 554.](#tms-connection-type)).

![image](docs_ngweb/source/_static/TMS_connection_type_en_3.png)

In the case of a custom connection method, the user must specify the URL template, API key parameters if needed and the tile scheme used. For NextGIS GeoServices, only a custom API key is specified. After filling in all fields click **Create** to complete the process of creating a **TMS Connection** resource.

<a id="ngw-tms-layer"></a>

### TMS layer

**TMS layer** resource is created using previously created **TMS Connection**. Click on **Create resource** button and select **TMS layer** (see [Fig. 555.](#tms-layer-create)).

![image](docs_ngweb/source/_static/ngweb_create_tms_layer_en.png)

Enter the name that will be displayed in the administrator interface (see [Fig. 556.](#tms-layer-name)).

![image](docs_ngweb/source/_static/TMS_layer_name_en_3.png)

Caching provides faster rendering of Web Map layers. Tile cache settings are described in details [in this section](https://docs.nextgis.com/docs_ngweb/source/mapstyles.html#tile-cache).

The main display settings are on the TMS layer tab (see [Fig. 557.](#tms-layer-settings-pic)):

* TMS connection - select a TMS connection resource that was created earlier;
* The range of zoom levels for data display;
* The extent in degrees;
* Tile size in pixels.

![image](docs_ngweb/source/_static/TMS_layer_settings_en_3.png)

After creating a TMS layer, the user can add it to the Web Map to display. No style is needed.
