leaflet-extras / leaflet-providers

An extension to Leaflet that contains configurations for various free tile providers.
https://leaflet-extras.github.io/leaflet-providers/preview/
BSD 2-Clause "Simplified" License
2.16k stars 668 forks source link

Esri.OceanBasemap not displaying #493

Closed hansenjohnson closed 1 year ago

hansenjohnson commented 1 year ago

I noticed that the map from Esri.OceanBasemap is not displaying (see provider demo page here). Perhaps it's due to Esri moving from an old to a new OceanBasemap? I was able to get around this issue by manually specifying the path to the new version of the basemap and reference layer.

brunob commented 1 year ago

From my side tiles are loaded on the demo page right now. Do you confirm ?

martinfleis commented 1 year ago

It is not working for me either and a downstream CI is also failing, with error 500.

brunob commented 1 year ago

Demo page is calling https://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/7/44/59

curl -LI https://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/7/44/59
HTTP/1.1 200 OK
Server: Apache
ETag: "2cs30m4psb2"
Access-Control-Allow-Origin: *
Content-Length: 9868
X-Robots-Tag: noindex
Content-Type: image/jpeg
Date: Tue, 31 Jan 2023 13:03:23 GMT
Connection: keep-alive
Cache-Control: max-age=86400

Did you test with one IP or multiple ? Maybe your IP si blocked due to traffic limit from esri ?

martinfleis commented 1 year ago
curl -LI https://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/7/44/59
HTTP/1.1 404 Not Found
Content-Type: text/html;charset=utf-8
Content-Length: 614
Connection: keep-alive
Date: Tue, 31 Jan 2023 13:07:56 GMT
Server: 
Access-Control-Allow-Origin: *
X-Robots-Tag: noindex
X-Cache: Error from cloudfront
Via: 1.1 3bf3e75bcb9a86b3eb343a1d4392a6de.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: FRA2-C1
X-Amz-Cf-Id: c1AtxwuoUlZ474098bsvNNJ9r8JVQZk9dIivNrau0S897OBqZkY6Iw==

This is from my local laptop, same with and without VPN. The same response from another machine elsewhere (via ssh). The CI that is failing in xyzservices is running on GHA, so completely detached from that. May it be that it is cached on your side?

brunob commented 1 year ago

'k got the 404 after testing from three different IPs.

This patch should do the trick :

diff --git a/leaflet-providers.js b/leaflet-providers.js
index a7ef138..47b9259 100644
--- a/leaflet-providers.js
+++ b/leaflet-providers.js
@@ -469,7 +469,7 @@
                },
                OceanBasemap: {
                    options: {
-                       variant: 'Ocean_Basemap',
+                       variant: 'Ocean/World_Ocean_Base',
                        maxZoom: 13,
                        attribution: '{attribution.Esri} — Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri'
                    }

PR is on the way.