{"_id":"56e00ece4685db1700d946f6","project":"55e06494a44fae0d002146aa","__v":2,"user":"55eea68fc93e8c17008a109c","category":{"_id":"56dd9448c117291700015b60","pages":["56e00ece4685db1700d946f6","56e01ad92bd3832000920444"],"__v":2,"version":"55e06495a44fae0d002146ad","project":"55e06494a44fae0d002146aa","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-03-07T14:46:32.881Z","from_sync":false,"order":28,"slug":"endpoint-3","title":"endpoint"},"version":{"_id":"55e06495a44fae0d002146ad","project":"55e06494a44fae0d002146aa","__v":54,"createdAt":"2015-08-28T13:39:33.907Z","releaseDate":"2015-08-28T13:39:33.907Z","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"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"editedParams":true,"editedParams2":true,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-09T11:53:50.086Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","code":"See image","language":"text","status":200},{"status":400,"name":"","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>","language":"xml"},{"code":"{\n    \"fault\": {\n        \"faultstring\": \"Invalid ApiKey\",\n        \"detail\": {\n            \"errorcode\": \"oauth.v2.InvalidApiKey\"\n        }\n    }\n}","language":"json","status":401},{"language":"json","status":404,"code":"{  \n   \"fault\":{  \n      \"faultstring\":\"Invalid ApiKey for given resource\",\n      \"detail\":{  \n         \"errorcode\":\"oauth.v2.InvalidApiKeyForGivenResource\"\n      }\n   }\n}"},{"code":"{  \n   \"fault\":{  \n      \"faultstring\":\"Received 405 Response without Allow Header\",\n      \"detail\":{  \n         \"errorcode\":\"protocol.http.Response405WithoutAllowHeader\"\n      }\n   }\n}","language":"json","status":405},{"status":500,"code":"{\n    \"error\": {\n        \"statuscode\": 500,\n        \"message\": \"The provided request resulted in an internal server error.\"\n    }\n}","language":"json"}]},"settings":"55e973568b72bb3700b1d5ac","examples":{"codes":[{"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>","language":"html","name":"Leaflet WMTS Web Mercator"},{"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>","language":"html","name":"OpenLayers 3 WMTS Web Mercator"}]},"method":"get","auth":"required","params":[{"_id":"56e0100c4685db1700d94705","ref":"","in":"query","required":true,"desc":"The service that is being accessed.","default":"WMTS","type":"string","name":"service"},{"_id":"56e0100c4685db1700d94704","ref":"","in":"query","required":true,"desc":"The type of request being made. If a GetCapabilities is request is being made, the other parameters are not required other than authentication.","default":"GetTile, GetCapabilities","type":"string","name":"request"},{"_id":"56e0100c4685db1700d94703","ref":"","in":"query","required":false,"desc":"The version number of the service. This parameter is required for GetTile requests.","default":"1.0.0","type":"string","name":"version"},{"_id":"56e0100c4685db1700d94702","ref":"","in":"query","required":false,"desc":"The layer being accessed by the service e.g. AddressBasePremium 27700. This parameter is required for GetTile requests.","default":"AddressBasePremium {CRS}","type":"string","name":"layer"},{"_id":"56e0100c4685db1700d94701","ref":"","in":"query","required":false,"desc":"The styling of the service. This parameter is required for GetTile requests.","default":"true","type":"boolean","name":"style"},{"_id":"56e0100c4685db1700d94700","ref":"","in":"query","required":false,"desc":"The format of the returned tile. This parameter is required for GetTile requests.","default":"image/png","type":"string","name":"format"},{"_id":"56e0100c4685db1700d946ff","ref":"","in":"query","required":false,"desc":"The coordinate reference system (CRS) for the tile being returned. This parameter is required for GetTile requests.","default":"EPSG:27700, EPSG:4258, EPSG:4326","type":"string","name":"tileMatrixSet"},{"_id":"56e0100c4685db1700d946fe","ref":"","in":"query","required":false,"desc":"The zoom level for the requested tile set e.g. EPSG:27700:9. This parameter is required for GetTile requests.","default":"{CRS}:{Zoom Level}","type":"string","name":"tileMatrix"},{"_id":"56e0100c4685db1700d946fd","ref":"","in":"query","required":false,"desc":"The requested row of the called tile. This parameter is required for GetTile requests.","default":"","type":"int","name":"tileRow"},{"_id":"56e0100c4685db1700d946fc","ref":"","in":"query","required":false,"desc":"The requested column of the called tile. This parameter is required for GetTile requests.","default":"","type":"int","name":"tileCol"}],"url":"/wmts?"},"isReference":true,"order":0,"body":"","excerpt":"","slug":"wmts","type":"endpoint","title":"WMTS"}

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 }}