---
url: https://docs.geo.admin.ch/preview/feat-pb-2457-test-codebuild-with-nodejs-v26/visualize-data/vector-tiles.md
---
# Vector Tiles

This service delivers vector map tiles and styles through a RESTful API. The vector tiles are provided according to the [Mapbox Vector Tile Specification](https://mapbox.github.io/vector-tile-spec/) while the map styles implement the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), ensuring compatibility with MapLibre-based clients and other applications supporting the specification.

## Styles

Use the following endpoint to get a certain style:

where `layerName` is one of the following values:

* Base Map: `ch.swisstopo.basemap.vt`
* Base Map Winter: `ch.swisstopo.basemap-winter.vt`
* Light Base Map: `ch.swisstopo.lightbasemap.vt`
* Imagery Base Map: `ch.swisstopo.imagerybasemap.vt`

::: tip
See the [corresponding page on geo.admin.ch](https://www.geo.admin.ch/en/vector-tiles-service-available-services-and-data) for more details on the available vector styles.
:::

An example request to get the Light Base Map:

## Tiles

Vector tiles and their meta data can be retrieved by specifying the right `layerName` parameter at the endpoints below.
Possible values for `layerName` are:

* Base: `ch.swisstopo.base.vt`
* Relief: `ch.swisstopo.relief.vt`

::: tip
See the [corresponding page on geo.admin.ch](https://www.geo.admin.ch/en/vector-tiles-service-available-services-and-data) for more details on the available vector tilesets.
:::

### Get a Tile

Use the following endpoint to get a specific tile:

| **Parameter** | **Example**          | **Description**                             |
| ------------- | -------------------- | ------------------------------------------- |
| layerName     | ch.swisstopo.base.vt | The technical name of the vector tile layer |
| version       | v1.0.0               | Version of the tileset                      |
| zoomLevel     | 7                    | Zoom level (integer)                        |
| x             | 67                   | Tile column (X coordinate in the tile grid) |
| y             | 44                   | Tile row (Y coordinate in the tile grid)    |

An example request for one `.pbf` tile in the Relief tileset:

```http
curl -o demo.pbf https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.relief.vt/v1.0.0/7/67/44.pbf
```

### Get a Tileset

MBTiles are used for storing tiled map data in SQLite databases for immediate or offline usage and for efficient transfer.

A request to get a tileset follows the following pattern:

| **Parameter** | **Example**          | **Description**                             |
| ------------- | -------------------- | ------------------------------------------- |
| layerName     | ch.swisstopo.base.vt | The technical name of the vector tile layer |
| version       | v1.0.0               | Version of the tileset                      |

An example request for a `.mbtiles` file in the Base Map dataset:

::: warning
The file in the example below is approximately **900MB** in size.
:::

```http
curl -o demo.mbtiles https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.base.vt/v1.0.0/ch.swisstopo.base.vt.mbtiles
```

### Metadata

Each tileset has a corresponding metadata json file that describes the available set of tiles.

A request to the metadata file looks like this:

| **Parameter** | **Example**          | **Description**                             |
| ------------- | -------------------- | ------------------------------------------- |
| layerName     | ch.swisstopo.base.vt | The technical name of the vector tile layer |
| version       | v1.0.0               | Version of the tileset                      |

An example request to get the metadata for the Base tileset:

## Examples

### MapLibre

An example using MapLibre to display the Light Base Map:

### OpenLayers

Another example that is using OpenLayers' [ol-mapbox-style](https://github.com/openlayers/ol-mapbox-style) library to display the Light Base Map.

The same example but using LV95 frame with OpenLayers:
