leaflet icon indicating copy to clipboard operation
leaflet copied to clipboard

addProviderTiles() failing to show basemap for ESRI basemaps

Open Snel82 opened this issue 3 years ago • 7 comments

Calling addProviderTiles() with any of the ESRI provider tiles returns no basemap.

Viewing the browser console shows: Failed to load resource: net::ERR_TOO_MANY_REDIRECTS.

The maps seem to work in other examples online (eg. https://leaflet-extras.github.io/leaflet-providers/preview/#filter=Esri.WorldImagery) but seemingly not in R

library(leaflet)

leaflet() %>% addProviderTiles("Esri.WorldImagery")
#leaflet() %>% addProviderTiles("Esri.WorldShadedRelief")
#leaflet() %>% addProviderTiles("Esri.WorldTerrain")

Snel82 avatar May 02 '22 23:05 Snel82

Hi, I can reproduce this using RStudio but not when running R directly from the console.

tim-salabim avatar May 04 '22 07:05 tim-salabim

I share the same problem as @Snel82 but I do not receive an error message when I run the code in Rstudio. The same code worked about 1-2 months ago. The only changes I made within that time is to update R, Rstudio and leaflet package. I recognized that this also affects

leaflet() %>% addProviderTiles(providers$Esri.WorldTopoMap)
leaflet() %>% addProviderTiles(providers$Esri.WorldShadedRelief)

Are there any known issues with ESRI provider tiles in general in the meaning of if they changed their policy? Also, are there any decent alternatives (the strength of the ESRI maps is that you can zoom in to very low levels)?

bsalak avatar May 04 '22 08:05 bsalak

With Firefox Network Analysis Tool you can see that the ESRI server replies HTTP 301 "moved permanently".

This is the URI for the service taken from arcgis.com: https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/0

leaflet() seems to use the following URI: https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/0

Test: https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/14/5497/8591 returns an image: image

https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/14/5497/8591 returns an error

markolipka avatar May 04 '22 12:05 markolipka

Well, for me, both work (only including screenshot for second one here): image

tim-salabim avatar May 04 '22 12:05 tim-salabim

"unfortunately", for me both links work, too :) Do we know if this is a leaflet thing or an ESRI thing (I am not an IT-specialist). Is there any workaround?

bsalak avatar May 04 '22 13:05 bsalak

it seems that the ESRI maps work in the meantime. at least my maps do show the wold.imagery background tiles again. i don't know how to check where the problem was. maybe directly at ESRI?

bsalak avatar May 05 '22 11:05 bsalak

I think the problem was in the WEB server. Two days after the problems the imagery return to occur. Thank you very much!

marcelocarvalhoalves avatar May 06 '22 16:05 marcelocarvalhoalves