Join us online - 19th of November
Save your spot
For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

OGC API – Tiles

OGC API – Tiles is an Open Geospatial Consortium standard for serving map tiles through a JSON-based web API. It’s the successor to WMTS.

MapTiler supports OGC API – Tiles for tilesets (raster and vector) and for maps (as raster tiles).

Note

To use OGC API – Tiles with MapTiler Server, see OGC API – Tiles in MapTiler Server.

When to use OGC API – Tiles

  • Your software supports the standard, for example OpenLayers.
  • Your project or organization requires OGC standards.
  • Your tileset uses a projection other than Web Mercator. The tile matrix set describes the tile grid in any coordinate system.

To get the URL for your map, open the sharing dialog and select the OGC API tab under Use map in other ways.

Endpoints

Endpoint Maps Tilesets
Landing page: describes the dataset and links to its tiles /maps/{mapId}/tiles /tiles/{tilesId}/tiles
Tile matrix sets: describe the tile grid /maps/{mapId}/tileMatrixSet /tiles/{tilesId}/tileMatrixSet

All endpoints use the base URL https://api.maptiler.com. The conformance classes that MapTiler implements are listed at https://api.maptiler.com/ogc/conformance.

Use the landing page URL in your software.

OpenLayers

Add the landing page URL as an OGCMapTile source:


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,
  }),
});

For a vector tileset, use ol.layer.VectorTile with an ol.source.OGCVectorTile source and format: new ol.format.MVT(). See the OpenLayers examples for OGC map tiles and OGC vector tiles.

Don’t forget to add attribution.

Other projections

OpenLayers only knows EPSG:4326 and EPSG:3857. For other projections, load the proj4 library and register the projection before you create the map. This example uses EPSG:5514:


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';
proj4.defs(projName, projDef);
ol.proj.proj4.register(proj4);

new ol.layer.Tile({
  source: new ol.source.OGCMapTile({
    projection: projName,
    url: 'https://api.maptiler.com/tiles/YOUR_TILESET_ID/tiles?key=YOUR_MAPTILER_API_KEY_HERE',
  }),
});
  • Projection name: use the crs value from the tile matrix set. OpenLayers also shows it in the console error Unsupported CRS: … when the projection isn’t registered.
  • Projection definition: copy it from epsg.io.

OpenLayers doesn’t read the tile grid from the tile matrix set, and it doesn’t set the initial view from the centerPoint property. Set both yourself if you need them.

QGIS

QGIS can’t load MapTiler OGC API – Tiles URLs directly. To use MapTiler maps in QGIS, use the MapTiler QGIS plugin or WMTS.

Was this helpful?