trafficonese/leaflet.extras

addSearchOSM() not working in exported Standalone Web Pages

Closed this issue · 3 comments

OpenStreetMap has updated their Authentication and I believe it's breaking addSearchOSM().

The addSearchOSM() search feature will not work with a Leaflet map that has been Exported to a Standalone Web Page. Here is the link to a July 2024 OSM Wiki Update that might have something to do with this suddenly not working.

Below, I've added an image of the Access Blocked page that appears in the browser console when attempting to use the OSM search. Here is the Usage Policy Link that is linked in the image.

image

When using RStudio's integrated Viewer the OSM search works without any issues. The issue only comes up when exporting the Leaflet to a Web Page and attempting to use the search there.

The following code is the minimum required to replicate the issue.

library(leaflet)
library(leaflet.extras)
leaflet()  %>% 
  addTiles() %>% 
  addSearchOSM()

I cannot reproduce this.
The OSM search is working for me in an exported leaflet map, in a shiny app and in the RStudio Viewer.
Maybe you made too many requests?

No heavy uses (an absolute maximum of 1 request per second).

Sorry about that, after some testing this seems to be an issue only effecting devices at my work. My personal computer had no problem with the OSM Search while my work laptop still couldn't get it to work. This must be a security problem with our work devices. I apologize for making this Issue post!

No worries, I'll close the issue then :)