Data sources
WMTS
Pre-rendered tiles, configured the way an SDI thinks about them: a capabilities URL and a layer identifier. Everything else is read from the service.
Try it: compare two basemap.at WMTS layers over a grey basemap: hillshading at 70 % opacity and a labels overlay.
What this demo shows
-
urlpoints toWMTSCapabilities.xml; map0 reads the tile template from it - map0 picks the first WebMercator-compatible tile matrix set and warns when a layer offers none
-
REST and KVP services both work; matrix identifiers like
EPSG:900913:7are mapped onto{z} - Zoom range, default style, bounds and legend come from the capabilities document
@camptocamp/ogc-client parses capabilities in a browser worker so that large XML documents can be processed separately from the interface.
Multiple tile hosts. A capabilities document can list several hosts, some
of which may be unavailable. map0 requests a sample tile from each candidate and uses the
first working host.
Configuration
{
"$schema": "https://map0.net/schema/v1.json",
"version": 1,
"meta": { "title": "basemap.at WMTS overlays" },
"map": { "center": [13.35, 47.35], "zoom": 9 },
"basemaps": [
{
"id": "grau",
"title": "Grey",
"type": "raster",
"url": "https://mapsneu.wien.gv.at/basemap/bmapgrau/normal/google3857/{z}/{y}/{x}.png",
"attribution": "© basemap.at",
"default": true
}
],
"layers": [
{
"id": "gelaende",
"type": "wmts",
"title": "Terrain (WMTS)",
"url": "https://mapsneu.wien.gv.at/basemap/1.0.0/WMTSCapabilities.xml",
"layer": "bmapgelaende",
"opacity": 0.7,
"attribution": "© basemap.at"
},
{
"id": "beschriftung",
"type": "wmts",
"title": "Labels (WMTS)",
"url": "https://mapsneu.wien.gv.at/basemap/1.0.0/WMTSCapabilities.xml",
"layer": "bmapoverlay",
"attribution": "© basemap.at"
}
]
}Optional keys
Add matrixSet, style or format when a service offers
several and you do not want map0's defaults:
{
"type": "wmts",
"url": "https://example.gv.at/wmts/1.0.0/WMTSCapabilities.xml",
"layer": "orthophoto",
"matrixSet": "EPSG:3857",
"style": "default",
"format": "image/jpeg"
}