rstudio / leaflet

R Interface to Leaflet Maps
http://rstudio.github.io/leaflet/
Other
798 stars 505 forks source link

addProviderTiles() failing to show basemap for ESRI basemaps #796

Open Snel82 opened 2 years ago

Snel82 commented 2 years ago

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")
tim-salabim commented 2 years ago

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

bsalak commented 2 years ago

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)?

markolipka commented 2 years ago

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

tim-salabim commented 2 years ago

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

bsalak commented 2 years ago

"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 commented 2 years ago

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?

marcelocarvalhoalves commented 2 years ago

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