Skip to content

Commit

Permalink
add button to reset zoom on overview map
Browse files Browse the repository at this point in the history
renaemyers committed Nov 3, 2023
1 parent b025c2e commit a9266eb
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ Imports:
ggplot2,
sf,
leaflet,
leaflet.extras,
plotly,
remotes,
writexl
1 change: 1 addition & 0 deletions R/Figures.R
Original file line number Diff line number Diff line change
@@ -415,6 +415,7 @@ TADA_OverviewMap <- function(.data) {
leaflet::addProviderTiles("Esri.WorldTopoMap", group = "World topo", options = leaflet::providerTileOptions(updateWhenZooming = FALSE, updateWhenIdle = TRUE)) %>%
leaflet::clearShapes() %>% # get rid of whatever was there before if loading a second dataset
leaflet::fitBounds(lng1 = min(sumdat$TADA.LongitudeMeasure), lat1 = min(sumdat$TADA.LatitudeMeasure), lng2 = max(sumdat$TADA.LongitudeMeasure), lat2 = max(sumdat$TADA.LatitudeMeasure)) %>% # fit to bounds of data in tadat$raw
leaflet.extras::addResetMapButton() %>% # button to reset to initial zoom and lat/long
leaflet::addCircleMarkers(
data = sumdat,
lng = ~TADA.LongitudeMeasure,

0 comments on commit a9266eb

Please sign in to comment.