0

I'm using Rmarkdown to make a report with mapdeck which uses javascript libraries (deckgl,mapboxgl, etc) to create maps.

Once I generate the map object I can scroll and zoom around and inspect the window. What'd I'd like to do is after I scroll and zoom, extract the current zoom and center location from the browser console/inspect window so I can hard code that as a starting point. As it is, I'm constantly guessing and checking (lots of rerendering the map) a starting location and zoom level to fine tune the starting point which seems unnecessary.

I found in the console mapboxgl.getZoom but that comes back as undefined. Is it possible to get that info from the console?

SymbolixAU
  • 25,502
  • 4
  • 67
  • 139
Dean MacGregor
  • 11,847
  • 9
  • 34
  • 72

1 Answers1

1

Use show_view_state = TRUE to get a live overlay of the view's "state"

mapdeck(show_view_state = TRUE)

enter image description here

SymbolixAU
  • 25,502
  • 4
  • 67
  • 139