Updating NLS section of leaflet-providers.js
redheadkelly opened this issue · 7 comments
NLS has moved their map layer to the MapTiler Cloud API so there is now an error when the layer is called in the Maps extension.
Below is the code provided on the MapTiler website for the 'UK Great Britain, Ordnance Survey one-inch to the mile (1:63,360), 'Hills' edition, 1885-1903' tile for the Leaflet map. There seems to be a different URL in the code depending on which tile being called. There are different pages on the website with different code for each tile and also for using that tile with OpenLayers, Leaflet, or Cesium
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js"></script>
<style>
#map {position: absolute; top: 0; right: 0; bottom: 0; left: 0;}
</style>
</head>
<body>
<div id="map">
<a href="https://www.maptiler.com" style="position:absolute;left:10px;bottom:10px;z-index:999;"><img src="https://api.maptiler.com/resources/logo.svg" alt="MapTiler logo"></a>
</div>
<p><a href="http://maps.nls.uk/projects/subscription-api/">National Library of Scotland</a></p>
<script>
var map = L.map('map').setView([55.78810, -3.16151], 4);
L.tileLayer('https://api.maptiler.com/tiles/uk-osgb63k1885/{z}/{x}/{y}.png?key=yaLOM7UkZgqqdRRm12S8',{
attribution: "\u003ca href=\"http://maps.nls.uk/projects/subscription-api/\"\u003eNational Library of Scotland\u003c/a\u003e",
crossOrigin: true
}).addTo(map);
</script>
</body>
</html>
Thanks.
Thx for the report, since theses are not available without a maptiler account, i think we should remove them from the repo. Any thoughts @jieter ?
To use the NLS Historic Maps API, you need to create an account in MapTiler Cloud and select the appropriate plan, based on whether your usage is commercial/non-commercial and the monthly traffic you expect.
https://maps.nls.uk/projects/api/index.html
Thx for the report, since theses are not available without a maptiler account, i think we should remove them from the repo. Any thoughts @jieter ?
This means that the NLS layer would no longer be available to use with the Maps extension in MediaWiki? I use this layer a lot on my wiki. My research is specifically about Scottish history. The combination of the leaflet maps & the NLS historical maps layer is irreplaceable in my project. Or maybe there are other possible solutions I'm unaware of?
@brunob There apparently is a free account. While I can understand the account requirement itself potentially being a deal breaker, that would just move the responsibility of implementation. I'd appreciate it if the layer could stay in this library.
I'm just curious where we stand on the NLS layers. I'm getting ready to move my development site to the public site so I'd like to make whatever adjustments I need to make so that this works. Thanks.
Maybe we should simply move these tiles in MapTiler provider https://github.com/leaflet-extras/leaflet-providers/blob/master/leaflet-providers.js#L404
ping @jieter ?
FYI, the original URL has now stopped working and returns 404. I suppose that moving these under MapTiler to indicate the MapTiler account is necessary makes sense. It is practically the same case what was done with Stamen tiles moving under Stadia.
Please review #535
Comments to that pull request:
- Update based on a test I did with a free subscription
- Now requires an API key
- I found seven different maps provided by NLS in the UK section of the website, but let me know if I missed anything.
- I focussed on NLS maps, but others are eligible for inclusion, e.g. "Bartholomew Ireland Quarter-Inch 1940s"
- In order to use its Web Map Tile Service, you would need to upgrade to a paid subscription, but you can still use "raster tiles with TileJSON or XYZ".
- I did not update the maxZoom, which seems to be different for each map (e.g. 14 or 15)