leaflet-extras/leaflet-providers

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.