---
title: "OGC API — Tiles in MapTiler | Guides | Maps apis | Maps platform"
description: "Using the OGC API - Tiles standard with MapTiler."
---

# OGC API — Tiles

The OGC API — Tiles standard defines endpoints for creating Web APIs that support retrieving geospatial information as tiles. It is a successor to the WMTS standard.

MapTiler supports the following JSON endpoints:

-   **Dataset landing page** defines a dataset and provides access to the tiles.
    -   [Tileset](https://docs.maptiler.com/cloud/api/tiles/#tag/tiles/GET/tiles/{tilesId}/tiles): `https://api.maptiler.com/tiles/{tilesId}/tiles`
    -   [Rasterized map](https://docs.maptiler.com/cloud/api/maps/#tag/maps/GET/maps/{mapId}/tiles): `https://api.maptiler.com/maps/{mapId}/tiles`
-   **Dataset TileMatrixSets** describes the dataset tile matrix sets according to the OGC Web API.
    -   [Tileset](https://docs.maptiler.com/cloud/api/tiles/#tag/tiles/GET/tiles/{tilesId}/tileMatrixSet): `https://api.maptiler.com/tiles/{tilesId}/tileMatrixSet`
    -   [Rasterized map](https://docs.maptiler.com/cloud/api/maps/#tag/maps/GET/maps/{mapId}/tileMatrixSet): `https://api.maptiler.com/maps/{mapId}/tileMatrixSet`
-   **Conformance Classes** declares the [conformance classes](https://docs.maptiler.com/cloud/api/other/#tag/other/GET/ogc/conformance) implemented within our API.
    -   `https://api.maptiler.com/ogc/conformance`

Warning

If you want to use OGC API — Tiles on MapTiler Server, go to [instructions for Server](https://docs.maptiler.com/guides/self-hosting/map-server/ogc-api-tiles-server/).

The **Dataset landing page** can be used in software supporting the OGC API — Tiles specification (currently OpenLayers).

## Getting started with OpenLayers

We’ve prepared an [OpenLayers demo viewer](https://labs.maptiler.com/openlayers-ogcapi/) for raster and vector tiles to showcase the capabilities. Implementing this in your web applications is straightforward, see the OpenLayers [OGC Vector Tiles](https://openlayers.org/en/latest/examples/ogc-vector-tiles.html) and [OGC Raster Tiles](https://openlayers.org/en/latest/examples/ogc-map-tiles.html) examples.

1.  Load the OpenLayers library in the `<head>` section and set the UTF-8 encoding.
    
    ```html
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ol@v10.1.0/ol.css">
    <script src="https://cdn.jsdelivr.net/npm/ol@v10.1.0/dist/ol.js"></script>
    ```
    
2.  Add an element to be inflated by the OpenLayers into the HTML `<body>`.
    

```html
<div id="map" style="width: 640px; height: 480px;"></div>
```

1.  Get your API key and the dataset landing page URL of a tileset or a rasterized map at [cloud.maptiler.com](https://cloud.maptiler.com/).
    
2.  Add JavaScript code that will initialize the OpenLayers raster map.
    
    ```
    <pre><code class="language-js"><!--
     new ol.Map({
    ```
    
    target: ‘map’, layers: \[ new ol.layer.Tile({ source: new ol.source.OGCMapTile({ url: ‘https://api.maptiler.com/maps/satellite-v4/tiles?key=YOUR\_MAPTILER\_API\_KEY\_HERE’, }), }), \], view: new ol.View({ center: \[0, 0\], zoom: 1, }), }); –></code></pre>
    
    ```
    1. The `target` must match the `id` of the inflated HTML element.
     2. Add a new raster layer (`Tile`) into the `layers` array with the `OGCMapTile` source.
     3. Set the initial zoom level and map position in the `view` property.
    ```
    
3.  To load a vector tileset, replace `Tile` with `VectorTile` and add some basic styling.
    
    ```
    <pre><code class="language-js"><!--
     new ol.layer.VectorTile({
    ```
    
    source: new ol.source.OGCVectorTile({ url: ‘https://api.maptiler.com/tiles/land/tiles?key=YOUR\_MAPTILER\_API\_KEY\_HERE’, format: new ol.format.MVT(), }), background: ‘#85CBFA’, style: { ‘fill-color’: ‘#FCF7E4’, }, }) –></code></pre>
    
4.  Add a proper [attribution](https://docs.maptiler.com/guides/map-design/attribution/add-attribution/).
    

### Custom projections with OpenLayers

OpenLayers library includes [definitions](https://openlayers.org/en/latest/apidoc/module-ol_proj_Projection-Projection.html) for `EPSG:4326` and `EPSG:3857`. Use `proj4` to define any other projection. Here is an example for `EPSG:5514`:

1.  Load `proj4` library in the `<head>` section.
    
    ```js
    <script src="https://cdn.maptiler.com/proj4js/v2.5.0/proj4.js"></script>
    ```
    
2.  Define the projection before `ol.Map` initialization:
    
    ```js
    const projName = "http://www.opengis.net/def/crs/EPSG/0/5514";
     const projDef = "+proj=krovak +lat_0=49.5 +lon_0=24.8333333333333 +alpha=30.2881397527778 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=589,76,480,0,0,0,0 +units=m +no_defs +type=crs"
     ol.proj.proj4.register(proj4);
     proj4.defs(projName, projDef);
    ```
    
    1.  The projection name (`projName`) is the `crs` URL:
        
        Look into the console for an error like this: `Error: Unsupported CRS: http://www.opengis.net/def/crs/EPSG/0/5514`
        
        Alternatively, look into the dataset definition for the `crs` property.
        
    2.  The projection definition (`projDef`) can be obtained:
        
        Manually from [epsg.io](https://epsg.io/5514.proj4), e.g. from [https://epsg.io/5514.proj4](https://epsg.io/5514.proj4).
        
        Dynamically using the [fromEPSGCode](https://openlayers.org/en/latest/apidoc/module-ol_proj_proj4.html#.fromEPSGCode) method, e.g. `ol.proj.proj4.fromEPSGCode("EPSG:5514")` (not recommended).
        
3.  Set the projection of the Non-Mercator OGCMapTile or OGCVectorTile source.
    
    ```
    <pre><code class="language-js"><!--
     new ol.layer.Tile({
    ```
    
    source: new ol.source.OGCMapTile({ projection: projName, url: ‘https://api-staging.maptiler.com/tiles/cz-satellite-5514/tiles?key=YOUR\_MAPTILER\_API\_KEY\_HERE’, }), }), –></code></pre>
    

### OpenLayers limitations

-   OpenLayers doesn’t automatically read or set `tileGrid` from the tileset tile matrix sets description.
-   The view is not initialized from the OGC API — Tiles `centerPoint` property.

## Getting started with QGIS

To use raster tiles in QGIS, you’ll need to create two more JSON files (endpoints). In this example, we will add a satellite map into QGIS.

1.  Create a new local JSON file, e.g. `tilesets.json`. This endpoint declares a list of the tileset projections.
    
    ```
    <pre><code class="language-js"><!--
    ```
    
    { “tilesets”: \[ { “dataType”: “map”, “crs”: “http://www.opengis.net/def/crs/EPSG/0/3857”, “links”: \[ { “rel”: “self”, “type”: “application/json”, “href”: “https://api.maptiler.com/maps/satellite-v4/tiles?key=YOUR\_MAPTILER\_API\_KEY\_HERE” } \] } \] } –></code></pre>
    
    ```
    Set the API URL to the desired tileset/map, including your API key.
    ```
    
2.  Create another file within the same folder, e.g. `landing.json`. This endpoint is a dataset landing page linking the previous endpoint. This file will be always the same.
    
    ```
    <pre><code class="language-js"><!--
    ```
    
    { “links”: \[ { “rel”: “http://www.opengis.net/def/rel/ogc/1.0/tilesets-map”, “type”: “application/json”, “href”: “/tilesets.json” } \], “extent”: { “spatial”: { “bbox”: \[\[-180, -85.0511, 180, 85.0511\]\] } } } –></code></pre>
    
3.  OGC API — Tiles is used to request tiled data from a web service, not directly load a static local file. You have to:
    1.  Upload the JSON files on some web server. Ensure that `href` link from `landing.json` to `tilesets.json` is correct.
    2.  Start a local server to serve the JSON files. In Python:
        1.  Open the terminal and go to the folder containing the JSON files.
        2.  Run: `python3 -m http.server`
        3.  The URL will be: `http://localhost:8000/landing.json`
4.  Load the dataset landing page endpoint in QGIS.
    1.  Go to menu **Layer** > **Add Layer** > **Add Raster Layer** (Ctrl+Shift+R).
    2.  As the **Source Type**, select `OGC API`.
    3.  As **Source**, enter the `landing.json` URL.

### QGIS limitations

-   OGC API — Tiles standard works only with QGIS 3.38 (GDAL 3.9). Supported operating systems are Windows and Linux Ubuntu 24.10.
-   QGIS doesn’t support reading tiles directly from the dataset landing page, and can only work with raster tilesets and raster collections.

It’s important to note that GDAL/QGIS implements the draft of the OGC API — Tiles standard and the implementation is likely to change.

Supporting QGIS is on our roadmap, and we plan to expand the compatibility.
