os-data-hub contains sample code for using Ordnance Survey Data Hub APIs with ArcGIS API for Javascript v4.
The Ordnance Survey Data Hub is a collection of APIs that provide access to a range of Open data and OS Premium data to support developers building apps.
The code samples in this repo demonstrate how a developer using the ArcGIS API for JavaScript v4 can get started with three of the APIs:
- OS Maps API - access raster tiles via OGC standard WMTS or RESTful ZXY.
- OS Vector Tile API - highly customisable vector tiles.
- OS Features API - run spatial and attribute queries against a web feature service.
- Switch between the different basemaps available from the Maps API.
- Use client-side code to style the vector tiles provided by the Vector Tile API.
- Query the OS Features API for all hospitals within the current map extent.
- Query the OS Features API for all sites within the current map extent. Use smart mapping to classify sites and adapt the legend colours to the selected basemap.
To use the samples you first need to sign up to the service and generate an API key.
Information about how to sign up can be found on the OS Data Hub Plans & Pricing page. See the Getting Started Guide for instructions about how to set up an API Project and obtaining the API key.
In the sample code replace INSERT_API_KEY_HERE
with your API key.
The OS Data Hub provides detailed documentation and examples about all three services.
This project uses the following license: Apache License 2.0.