Stylesheet
API test authentication
The Open API block allows you to test OS APIs directly from the page with example data and parameters. To use this feature, you will need to add your API Key or OAuth2 token to the authentication field.
For help generating an API Key or OAuth2 token, please see the Getting started with an API project or OAuth2 documentation.
Authorizations
keystringRequired
keystringRequired
OAuth2clientCredentialsRequired
Token URL:
Query parameters
srsstring · enumOptionalDefault:
The Spatial Reference System for the service.
27700Possible values: Responses
200
Retrieves compatible stylesheets
application/json
get
/vts/resources/stylesGET /maps/vector/v1/vts/resources/styles HTTP/1.1
Host: api.os.uk
key: YOUR_API_KEY
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
200
Retrieves compatible stylesheets
{
"version": 1,
"sprite": "text",
"glyphs": "text",
"sources": {
"ANY_ADDITIONAL_PROPERTY": {
"type": "text",
"url": "text"
}
},
"layers": [
{
"id": "text",
"type": "text",
"source": "text",
"source-layer": "text",
"filter": [
"text"
],
"minzoom": 1,
"maxzoom": 1,
"layout": {},
"paint": {}
}
]
}Authorizations
keystringRequired
keystringRequired
OAuth2clientCredentialsRequired
Token URL:
Path parameters
layer-namestring · enumRequiredPossible values:
The name of the data overlay.
Query parameters
srsstring · enumOptionalDefault:
The Spatial Reference System for the service.
27700Possible values: Responses
200
Returns compatible stylesheets for a data overlay.
application/json
get
/vts/{layer-name}/resources/stylesGET /maps/vector/v1/vts/{layer-name}/resources/styles HTTP/1.1
Host: api.os.uk
key: YOUR_API_KEY
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
200
Returns compatible stylesheets for a data overlay.
{
"version": 1,
"sprite": "text",
"glyphs": "text",
"sources": {
"ANY_ADDITIONAL_PROPERTY": {
"type": "text",
"url": "text"
}
},
"layers": [
{
"id": "text",
"type": "text",
"source": "text",
"source-layer": "text",
"filter": [
"text"
],
"minzoom": 1,
"maxzoom": 1,
"layout": {},
"paint": {}
}
]
}Last updated
Was this helpful?