OpenSeaMap tiles not getting loaded in R

294 Views Asked by At

I am trying to load OpenSeaMap as a provider tile in leaflet in R.

leaflet() %>% addProviderTiles(providers$OpenSeaMap) %>% addMarkers(lng = df$Lon,
                                        lat=df$Lat,
                                        label=lapply(labs2, HTML))

However, the tiles are not getting loaded and I get an empty map. No errors, just an empty map with no tiles and my markers correctly plotted. Any idea what the problem could be?

1

There are 1 best solutions below

0
On

Ok, through some trial and error, I think I've made it to work. I just added the default addTiles() before the addProviderTiles(). That seems to work, though I find it a bit strange.

leaflet() %>% addTiles() %>% addProviderTiles(providers$OpenSeaMap) %>% addMarkers(lng = df$Lon,
                                        lat=df$Lat,
                                        label=lapply(labs2, HTML))