在闪亮的传单r中将缩放级别设置为7.25

问题描述:

使用闪亮的上下文中的传单功能,我已经能够创建一个很棒的交互式地图.我想将缩放比例设置为7到7.5之间(例如7.25).我尝试这样做,如下面的代码所示,但地图中的缩放级别保持不变.似乎可以将缩放级别设置为7或7.5,而在这些数字之间不能设置任何值.如何解决这个问题?谢谢.

Using leaflet function within the shiny context, I have been able to create a great interactive map. I would like to set the zoom to somewhere between 7 and 7.5 (e.g., 7.25). I tried to do so as is shown in the code below but the zoom level in the map remained unchanged. It appears that one can set the zoom level to either 7 or 7.5 not anything between these numbers. How can fix this? Thanks.

setView(-82.706838, 40.358615, zoom=7.25)

使用传单地图选项:

  • zoomSnap :多小您可以定义缩放级别.
  • zoomDelta :多少单击缩放控制按钮时视图会缩放
leaflet(options = leafletOptions(zoomSnap = 0.25, zoomDelta=0.25)) %>%
  addTiles()%>%
  setView(lng=-82.706838, lat=40.358615, zoom=7.25)