Display BaseMaps served via ADS on a Leaflet Map
The content of this page is deprecated. Please visit https://osdatahub.os.uk/docs/wmts/overview to find out about the OS Maps API EPSG:3857 XYZ base map and the provided code example https://labs.os.uk/public/os-data-hub-examples/os-maps-api/zxy-3857-basic-map#leaflet .
Problem
Can BaseMaps served via ADS be displayed on a Leaflet Map?
Solution
Astun provide both OS Premium Colour and Greyscale BaseMaps as a Web Mercator XYZ tile service as part of Astun Data Services. These layers use the same tiling scheme as OSM and Google maps and are therefore compatible with Leaflet without having to specify a custom projection.
Example HTML
The URL templates are as follows replacing your-account-name with your Astun Data Services account name.
The following code demonstrates adding the OS Premium BaseMap to a Leaflet map you will just need to decide which of the above URL templates you wish to use and update accordingly.