0

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?

Dhiraj
  • 1,650
  • 1
  • 18
  • 44

1 Answers1

0

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))
Dhiraj
  • 1,650
  • 1
  • 18
  • 44