{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/wmts?","auth":"required","results":{"codes":[{"status":200,"language":"text","code":"See image","name":""},{"language":"xml","code":"{}// Example: Missing mandatory parameter\n\n<ExceptionReport xmlns=\"http://www.opengis.net/ows/1.1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.1.0\" xsi:schemaLocation=\"http://www.opengis.net/ows/1.1 http://geowebcache.org/schema/ows/1.1.0/owsExceptionReport.xsd\">\n\t<Exception exceptionCode=\"MissingParameterValue\" locator=\"TILEMATRIXSET\">\n\t\t<ExceptionText>No TILEMATRIXSET specified</ExceptionText>\n\t</Exception>\n</ExceptionReport>\n\n\n// Example: Parameter entry of wrong type\n\n<ExceptionReport xmlns=\"http://www.opengis.net/ows/1.1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.1.0\" xsi:schemaLocation=\"http://www.opengis.net/ows/1.1 http://geowebcache.org/schema/ows/1.1.0/owsExceptionReport.xsd\">\n\t<Exception exceptionCode=\"InvalidParameterValue\" locator=\"TILEMATRIXSET\">\n\t\t<ExceptionText>\nUnable to match requested TILEMATRIXSET x to those supported by layer\n\t\t</ExceptionText>\n\t</Exception>\n</ExceptionReport>\n\n\n// Example: Wrong parameter name\n\n<ExceptionReport xmlns=\"http://www.opengis.net/ows/1.1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.1.0\" xsi:schemaLocation=\"http://www.opengis.net/ows/1.1 http://geowebcache.org/schema/ows/1.1.0/owsExceptionReport.xsd\">\n\t<Exception exceptionCode=\"MissingParameterValue\" locator=\"TILEMATRIXSET\">\n\t\t<ExceptionText>No TILEMATRIXSET specified</ExceptionText>\n\t</Exception>\n</ExceptionReport>","name":"","status":400},{"status":401,"language":"json","code":"{\n    \"fault\": {\n        \"faultstring\": \"Invalid ApiKey\",\n        \"detail\": {\n            \"errorcode\": \"oauth.v2.InvalidApiKey\"\n        }\n    }\n}"},{"code":"{  \n   \"fault\":{  \n      \"faultstring\":\"Invalid ApiKey for given resource\",\n      \"detail\":{  \n         \"errorcode\":\"oauth.v2.InvalidApiKeyForGivenResource\"\n      }\n   }\n}","status":404,"language":"json"},{"status":405,"language":"json","code":"{  \n   \"fault\":{  \n      \"faultstring\":\"Received 405 Response without Allow Header\",\n      \"detail\":{  \n         \"errorcode\":\"protocol.http.Response405WithoutAllowHeader\"\n      }\n   }\n}"},{"language":"json","code":"{\n    \"error\": {\n        \"statuscode\": 500,\n        \"message\": \"The provided request resulted in an internal server error.\"\n    }\n}","status":500}]},"settings":"55e973568b72bb3700b1d5ac","examples":{"codes":[{"name":"Leaflet WMTS Web Mercator","language":"html","code":"<link rel=\"stylesheet\" href=\"http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css\" />\n<script src=\"http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js\"></script>\n\n<div id=\"map\" style='height: 500px; width: 500px;'></div>\n<script type='text/javascript'>\nvar map = L.map('map').setView([51.505, -0.09], 15);\nvar url = \"https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/wmts\";\nvar apiKey = \"[[app:key]]\";\n\nL.tileLayer(url + '?key='+apiKey+'&height=256&width=256&tilematrixSet=EPSG%3A3857&version=1.0.0&style=&layer=AddressBasePremium 3857&SERVICE=WMTS&REQUEST=GetTile&format=image/png&TileMatrix=EPSG:3857:{z}&TileRow={y}&TileCol={x}', {\n    maxZoom: 20,\n    minZoom: 7, \n    continuousWorld: true,\n}).addTo(map);\n</script>"},{"name":"OpenLayers 3 WMTS Web Mercator","language":"html","code":"<link rel=\"stylesheet\" href=\"http://openlayers.org/en/v3.0.0/css/ol.css\" type=\"text/css\">\n<script src=\"http://openlayers.org/en/v3.0.0/build/ol.js\" type=\"text/javascript\"></script>\n\n<div id=\"map\" style='height: 500px; width: 500px;'></div>\n<script>\n\n  var url = \"https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/wmts?key=[[app:key]]\";\n\n\tvar projection = ol.proj.get('EPSG:3857');\n\tvar projectionExtent = projection.getExtent();\n\tvar size = ol.extent.getWidth(projectionExtent) / 256;\n\tvar resolutions = new Array(14);\n\tvar matrixIds = new Array(14);\n\tfor (var z = 7, i = 20; z < 21; z++, i--) {\n\t\t// generate resolutions and matrixIds arrays for this WMTS\n\t\tmatrixIds[z] = \"EPSG:3857:\" + z;\n\t\tresolutions[z] = size / Math.pow(2, z);\n\t}\n\tvar attribution = new ol.Attribution({\n\t\thtml : '&copy; <a href=\"http://www.ordnancesurvey.co.uk/\">Ordnance Survey</a>'\n\t});\n\n\tvar map = new ol.Map({\n\t\ttarget : 'map',\n\t\tprojection: projection,\n\t\tlayers : [\n\t\t\t\tnew ol.layer.Tile({\n\t\t\t\t\tsource : new ol.source.WMTS({\n\t\t\t\t\t\tattributions : [attribution],\n\t\t\t\t\t\turl : url,\n\t\t\t\t\t\tlayer : 'AddressBasePremium 3857',\n\t\t\t\t\t\tmatrixSet : 'EPSG:3857',\n\t\t\t\t\t\tformat : 'image/png',\n\t\t\t\t\t\tprojection : projection,\n\t\t\t\t\t\ttileGrid : new ol.tilegrid.WMTS({\n\t\t\t\t\t\t\torigin : ol.extent.getTopLeft(projectionExtent),\n\t\t\t\t\t\t\tresolutions : resolutions,\n\t\t\t\t\t\t\tmatrixIds : matrixIds\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t})],\n\t\tview : new ol.View({\n\t\t\tcenter : ol.proj.transform([ -1.470625, 50.93788 ], 'EPSG:4326','EPSG:3857'),\n\t\t\tmaxZoom : 20,\n\t\t\tminZoom : 7,\n\t\t\tzoom : 9\n\t\t})\n\t});\n\tmap.addControl(new ol.control.ZoomSlider());\n</script>"}]},"method":"get","params":[{"name":"service","type":"string","default":"WMTS","desc":"The service that is being accessed.","required":true,"in":"query","ref":"","_id":"56e0100c4685db1700d94705"},{"name":"request","type":"string","default":"GetTile, GetCapabilities","desc":"The type of request being made. If a GetCapabilities is request is being made, the other parameters are not required other than authentication.","required":true,"in":"query","ref":"","_id":"56e0100c4685db1700d94704"},{"name":"version","type":"string","default":"1.0.0","desc":"The version number of the service. This parameter is required for GetTile requests.","required":false,"in":"query","ref":"","_id":"56e0100c4685db1700d94703"},{"name":"layer","type":"string","default":"AddressBasePremium {CRS}","desc":"The layer being accessed by the service e.g. AddressBasePremium 27700. This parameter is required for GetTile requests.","required":false,"in":"query","ref":"","_id":"56e0100c4685db1700d94702"},{"name":"style","type":"boolean","default":"true","desc":"The styling of the service. This parameter is required for GetTile requests.","required":false,"in":"query","ref":"","_id":"56e0100c4685db1700d94701"},{"name":"format","type":"string","default":"image/png","desc":"The format of the returned tile. This parameter is required for GetTile requests.","required":false,"in":"query","ref":"","_id":"56e0100c4685db1700d94700"},{"name":"tileMatrixSet","type":"string","default":"EPSG:27700, EPSG:4258, EPSG:4326","desc":"The coordinate reference system (CRS) for the tile being returned. This parameter is required for GetTile requests.","required":false,"in":"query","ref":"","_id":"56e0100c4685db1700d946ff"},{"name":"tileMatrix","type":"string","default":"{CRS}:{Zoom Level}","desc":"The zoom level for the requested tile set e.g. EPSG:27700:9. This parameter is required for GetTile requests.","required":false,"in":"query","ref":"","_id":"56e0100c4685db1700d946fe"},{"name":"tileRow","type":"int","default":"","desc":"The requested row of the called tile. This parameter is required for GetTile requests.","required":false,"in":"query","ref":"","_id":"56e0100c4685db1700d946fd"},{"name":"tileCol","type":"int","default":"","desc":"The requested column of the called tile. This parameter is required for GetTile requests.","required":false,"in":"query","ref":"","_id":"56e0100c4685db1700d946fc"}]},"next":{"description":"","pages":[]},"title":"WMTS","type":"endpoint","slug":"wmts","excerpt":"","body":"","updates":[],"order":0,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"56e00ece4685db1700d946f6","project":"55e06494a44fae0d002146aa","__v":2,"githubsync":"","user":"55eea68fc93e8c17008a109c","category":{"sync":{"isSync":false,"url":""},"pages":["56e00ece4685db1700d946f6","56e01ad92bd3832000920444"],"title":"endpoint","slug":"endpoint-3","order":28,"from_sync":false,"reference":true,"_id":"56dd9448c117291700015b60","__v":2,"createdAt":"2016-03-07T14:46:32.881Z","version":"55e06495a44fae0d002146ad","project":"55e06494a44fae0d002146aa"},"createdAt":"2016-03-09T11:53:50.086Z","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["55e06496a44fae0d002146ae","55e06997a44fae0d002146c2","55e06a6958c5460d0076aa0c","55e06ae66bad670d0081f25c","55e06cc1a44fae0d002146cb","55e06ddda44fae0d002146cd","55e95f261fd7e82300ef359f","55e95fe47fc27b2d00d32cfa","55e96eef358d923700be984d","55e96ef6358d923700be984e","55e96efda7ca823900ad547e","55e96f04a7ca823900ad547f","55e970cc358d923700be9853","55e973f4358d923700be9858","55e973f9a7ca823900ad548c","55e977bf358d923700be985d","55e9780f8b72bb3700b1d5bd","55e97815a7ca823900ad5493","55e9781c358d923700be985f","55e97821461e2a390050f23b","55f963c23bb4bb0d0022d18c","5624c67406e8040d005ed6b2","5624dcf25a86b423009462e8","5625f229d0f87e190014c4ed","5627819fe2ce610d004e3ec8","562781b23a4c6b0d00c4556b","5627837166c62617009d17e2","5627851efcbbc621004ebff1","5627860044c87f0d00fe6491","562e3c6d54a5be0d00070c3e","564c955aae6cb82100dc137a","5652e22abbe7110d00dba748","5652f25523d4262d00b21c58","5652fdad51e4e81900bf2452","5652fdcbb60abb1700bafadc","5654494f65bec717007e0293","565da11a77f0090d005818ff","565f063f413e06170093de18","565f06fb413e06170093de21","56dd6773efaca42900e5f58e","56dd68630c3bb41700b0b037","56dd7d24d5419f170075dfb3","56dd9448c117291700015b60","56dd9454c117291700015b61","577a6f8b9748b80e00ef3f45","577a6f969748b80e00ef3f46","577bba7f6e5f301900fada99","57a9cc8e5b1ace0e00de743f","58aab134c50c33250046b8f8","58aab146aecc3e2500573d4c","58aab1628f862f250076f92e","58aab1938f862f250076f92f","58aab3e5aecc3e2500573d56","58aab3f2aecc3e2500573d57"],"_id":"55e06495a44fae0d002146ad","releaseDate":"2015-08-28T13:39:33.907Z","createdAt":"2015-08-28T13:39:33.907Z","project":"55e06494a44fae0d002146aa","__v":54},"parentDoc":null,"editedParams":true,"editedParams2":true}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

service:
required
stringWMTS
The service that is being accessed.
request:
required
stringGetTile, GetCapabilities
The type of request being made. If a GetCapabilities is request is being made, the other parameters are not required other than authentication.
version:
string1.0.0
The version number of the service. This parameter is required for GetTile requests.
layer:
stringAddressBasePremium {CRS}
The layer being accessed by the service e.g. AddressBasePremium 27700. This parameter is required for GetTile requests.
style:
booleantrue
The styling of the service. This parameter is required for GetTile requests.
format:
stringimage/png
The format of the returned tile. This parameter is required for GetTile requests.
tileMatrixSet:
stringEPSG:27700, EPSG:4258, EPSG:4326
The coordinate reference system (CRS) for the tile being returned. This parameter is required for GetTile requests.
tileMatrix:
string{CRS}:{Zoom Level}
The zoom level for the requested tile set e.g. EPSG:27700:9. This parameter is required for GetTile requests.
tileRow:
integer
The requested row of the called tile. This parameter is required for GetTile requests.
tileCol:
integer
The requested column of the called tile. This parameter is required for GetTile requests.

Examples


Result Format


User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}