{"_id":"5621115b9288c00d00bb1e35","parentDoc":null,"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"},"editedParams":true,"project":"55e06494a44fae0d002146aa","user":"55eea68fc93e8c17008a109c","editedParams2":true,"category":{"_id":"55e973f4358d923700be9858","__v":1,"pages":["5621115b9288c00d00bb1e35"],"version":"55e06495a44fae0d002146ad","project":"55e06494a44fae0d002146aa","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-09-04T10:35:32.112Z","from_sync":false,"order":3,"slug":"endpoint-2","title":"endpoint"},"__v":3,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-16T15:01:47.080Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"get","results":{"codes":[{"code":"See image","language":"text","status":200,"name":""},{"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=\"IncorrectURLPath\" locator=\"request\">\n\t\t<ExceptionText>\nFormat is /zxy/{tilematrixSet}/{layer}/{z}/{x}/{y}.{imgFormat} Length was 6\n\t\t</ExceptionText>\n\t</Exception>\n</ExceptionReport>\n\n// Example: Parameter entry of wrong type\n\nIn progress\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=\"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>","language":"xml","status":400},{"code":"{\n    \"fault\": {\n        \"faultstring\": \"Invalid ApiKey\",\n        \"detail\": {\n            \"errorcode\": \"oauth.v2.InvalidApiKey\"\n        }\n    }\n}","language":"json","status":401},{"code":"{  \n   \"fault\":{  \n      \"faultstring\":\"Invalid ApiKey for given resource\",\n      \"detail\":{  \n         \"errorcode\":\"oauth.v2.InvalidApiKeyForGivenResource\"\n      }\n   }\n}","language":"json","status":404},{"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},{"code":"{\n    \"error\": {\n        \"statuscode\": 500,\n        \"message\": \"The provided request resulted in an internal server error.\"\n    }\n}","language":"text","status":500}]},"settings":"55e973568b72bb3700b1d5ac","examples":{"codes":[{"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);\n\nL.tileLayer('https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/zxy/EPSG%3A3857/Outdoor 3857/{z}/{x}/{y}.png?key=[[app:key]]', {\n    maxZoom: 20,\n    minZoom: 7\n}).addTo(map);\n</script>","name":"Leaflet ZXY Web Mercator"},{"name":"OpenLayers 3 ZXY Web Mercator","language":"html","code":"<script src=\"http://openlayers.org/en/v3.12.0/build/ol.js\" type=\"text/javascript\"></script>\n\n<div id=\"map\" style='height: 500px; width:500px;'></div>\n<script type='text/javascript'>\n\tvar map = new ol.Map({\n\t\ttarget : 'map',\n\t\tlayers : [ new ol.layer.Tile({\n\t\t\tsource : new ol.source.XYZ({\n\t\t\t\turl: 'https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/zxy/EPSG%3A3857/Outdoor 3857/{z}/{x}/{y}.png?key=[[app:key]]'\n\t\t\t\t})\n\t\t\t})\n\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\tzoom : 9\n\t\t})\n\t});\n</script>"},{"code":"Sample ZXY coordinates showing the OS HQ in Southampton.\nEPSG: 3857\n\nZ   X\t     Y\n7   63     42\n8   126    85\n9   253    171\n10  507    343\n11  1015   686\n12  2031   1372","language":"text","name":"Sample Coordinates"}]},"auth":"required","params":[{"_id":"5621115b9288c00d00bb1e3b","ref":"","in":"path","required":true,"desc":"The tile matrix set that will be used for the layer.","default":"EPSG:3857, EPSG:27700","type":"string","name":"tilematrixset"},{"_id":"5621115b9288c00d00bb1e3a","ref":"","in":"path","required":true,"desc":"The layer that will be used.","default":"Outdoor 3857","type":"string","name":"layer"},{"_id":"5621115b9288c00d00bb1e39","ref":"","in":"path","required":true,"desc":"The z index of the map layer.","default":"7-20","type":"int","name":"z"},{"_id":"5621115b9288c00d00bb1e38","ref":"","in":"path","required":true,"desc":"The x index of the map layer.","default":"","type":"int","name":"x"},{"_id":"5621115b9288c00d00bb1e37","ref":"","in":"path","required":true,"desc":"The y index of the map layer.","default":"","type":"int","name":"y"},{"_id":"5621115b9288c00d00bb1e36","ref":"","in":"path","required":true,"desc":"The image format that the service will return.","default":"PNG","type":"string","name":"imgformat"}],"url":"/zxy/:tilematrixset/:layer/:z/:x/:y.:imgformat?"},"isReference":true,"order":1,"body":"##Resulting Image\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/VSIpIIrSQSieumto1Ri6_zxy_200.png\",\n        \"zxy_200.png\",\n        \"256\",\n        \"256\",\n        \"#f3f3eb\",\n        \"\"\n      ],\n      \"caption\": \"The tile produced by the sample request above.\"\n    }\n  ]\n}\n[/block]\n##Try it out requests\n\nPlease note that any requests made to the OS Maps API via the Try it out form will result in two separate calls being made against the API key used.","excerpt":"OS Maps ZXY","slug":"os-maps-zxy","type":"endpoint","title":"ZXY"}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

tilematrixset:
required
stringEPSG:3857, EPSG:27700
The tile matrix set that will be used for the layer.
layer:
required
stringOutdoor 3857
The layer that will be used.
z:
required
integer7-20
The z index of the map layer.
x:
required
integer
The x index of the map layer.
y:
required
integer
The y index of the map layer.
imgformat:
required
stringPNG
The image format that the service will return.

Examples


Result Format


Documentation

##Resulting Image [block:image] { "images": [ { "image": [ "https://files.readme.io/VSIpIIrSQSieumto1Ri6_zxy_200.png", "zxy_200.png", "256", "256", "#f3f3eb", "" ], "caption": "The tile produced by the sample request above." } ] } [/block] ##Try it out requests Please note that any requests made to the OS Maps API via the Try it out form will result in two separate calls being made against the API key used.

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