When I add a simple map to my shiny application, without adding polygons, the zoom argument works correctly, and the map initializes as it should.
On the other hand, when I add polygons with add_polygon(), the map is initialized more zoomed out than it should.
Why is this happening?
This is my code:
library(mapdeck)
library(sf)
sf = st_as_sf(my_LargeSpatialPolygonDataframe)
output$my_map = renderMapdeck({
mapdeck(token = mytoken, location = c(a, b), zoom = 12,
bearing = -45.00, pitch = 0, style = 'mapbox://styles/mapbox/light-v9') %>%
add_polygon(data = sf,
stroke_colour = "#000000",
stroke_width = 20,
stroke_opacity = 200,
fill_opacity = 0,
layer = "init_polygons")
})