New here, well, after a long hiatus...
Think it's a fairly simple fix, but going round in circles and tired.
In Leaflet (R), once basemap has been successfully loaded, once I add my local shapefile, the basemap disappears.
R leaflet: adding polygons from shapefile removes tiles
Above does not return a successful result.
What have I missed?
data_test <- read_sf("Ports_100km_test.geojson")
data_test <- st_transform(data_test, crs = '+proj=longlat +datum=WGS84')
map <- leaflet() %>%
addProviderTiles(providers$Esri.OceanBasemap) %>%
setView(lng = -4.2026458, lat = 56.4906712, zoom = 5)
map
map <- leaflet() %>%
addTiles(providers$Esri.OceanBasemap) %>%
setView(lng = -4.2026458, lat = 56.4906712, zoom = 5) %>%
addPolygons(data = data_test, color = "blue", stroke = 0.5, opacity = 0.5
)
map
I expected a basemap with my shapefile overlayed.