---
title: "GET /{country}/{version}/{level}/tile/{z}/{x}/{y}.mvt"
method: GET
path: "/{country}/{version}/{level}/tile/{z}/{x}/{y}.mvt"
---

# GET /{country}/{version}/{level}/tile/{z}/{x}/{y}.mvt

`GET /{country}/{version}/{level}/tile/{z}/{x}/{y}.mvt`

## Request

- The document declares no server URL.
- Auth: none declared

Mapbox vector tile endpoint. {z}, {x}, and {y} correspond to tile zoom and coordinates used by Mapbox
GL (or other vector mapping software) to request a specific tile at a particular zoom level.

## Response `200`

The response is a Mapbox Vector Tile. Use this endpoint as a 'source' of a Mapbox layer, see their
[docs](https://www.mapbox.com/mapbox-gl-js/example/third-party/) for more information.

Note that the returned tiles have two layers, a geometry layer, and a label layer. The geometry layer's
name is the same as the `level` parameter used in the request, the label layer's name is `level`-label
(see `source-layer` in the snippet below). Features returned have three properties: `code`, `name`,
and `level`. Currently feature ids are not supported, therefore feature highlighting/restyling in
Mapbox GL is not supported.

**Example Mapbox GL snippet**:
```javascript
let username = '<your username>';
let password = '<your password>';
mapboxgl.accessToken = '<your access token>';
let map = new mapboxgl.Map({
  container: 'map',
  style: 'mapbox://styles/mapbox/light-v9',
  zoom: 4,
  center: [-100.447303, 37.753574],
  // add basic auth for gis requests
  transformRequest: (url, resourceType) => {
    if(resourceType == 'Tile' && url.startsWith('https://emsiservices.com')) {
      return {
        url: url,
        headers: {
          'Authorization': 'Basic ' + btoa(`${username}:${password}`)
        }
      };
    }
  }
});

map.on('load', () => {
  let level = 'state';

  map.addSource('test-source', {
    type: 'vector',
    tiles: [`https://emsiservices.com/gis/v1/us/2018.3/${level}/tile/{z}/{x}/{y}.mvt`]
  });

  // geometry layer
  map.addLayer({
    id: 'test',
    type: 'fill',
    source: 'test-source',
    'source-layer': level,
    paint: {
      'fill-color': 'blue',
      'fill-opacity': 0.6
    }
  });
  // label layer
  map.addLayer({
    id: 'test-label',
    type: 'symbol',
    source: 'test-source',
    'source-layer': `${level}-label`,
    paint: {
      'text-color': '#666',
      'text-halo-color': 'rgba(255,255,255,0.95)',
      'text-halo-width': 2
    },
    layout: {
      'symbol-placement': 'point',
      'text-field': "{name}",
      'text-font': [
        "Open Sans Semibold",
        "Arial Unicode MS Bold"
      ],
      'text-letter-spacing': 0.1,
      'text-size': 12
    }
  });
});
```

## Other responses

- `204`: Tiles that do not have data will respond with a 204 response code.
- `404`: Resource not found.

---

[API](https://skmtc.dev/lightcast/apis/gis-service.md) - [All operations](https://skmtc.dev/lightcast/apis/gis-service/llms.txt) - [OpenAPI document](https://skmtc.dev/lightcast/apis/gis-service/revisions/462e1994f934?raw)
