qfes / rdeck

Deck.gl widget for R
https://qfes.github.io/rdeck
MIT License
97 stars 0 forks source link

Impossible to set map bounds *and* pitch, bearing, etc #116

Open JosiahParry opened 3 months ago

JosiahParry commented 3 months ago

Using initial_view_state with view_state() one get adjust the way that their map looks allowing them to change the pitch and bearing. This is particularly handy for 3D / extruded shapes. However, view_state() does not let you specify a starting bound only a starting center point.

The initial bounds should only conflict with the center argument of view_state() not all others.

This would save one from doing:

view_state(
    center = {  
      sf::st_bbox(geoms) |> 
      sf::st_as_sfc() |>  
      sf::st_centroid() 
  }[[1]]
)
anthonynorth commented 3 months ago

Preserving the pitch and bearing is simple. It should be simple to rotate the initial_bounds by bearing also.