@@ -2,7 +2,42 @@ library(leaflet)
2
2
library(dplyr )
3
3
4
4
function (input , output , session ) {
5
- rvs <- reactiveValues(to_load = NULL , map = NULL , to_load_rehab = NULL , map_rehab = NULL , map_complete = FALSE , map_rehab_complete = FALSE )
5
+ rvs <- reactiveValues(to_load = NULL , map = NULL , to_load_rehab = NULL , map_rehab = NULL , map_complete = FALSE , map_rehab_complete = FALSE , map_tour = NULL , tour_tab = 1 )
6
+
7
+ output $ map_tour <- renderLeaflet({
8
+ rvs $ map_tour <-
9
+ leaflet(options = leafletOptions(minZoom = 5 )) %> %
10
+ setMaxBounds(lng1 = 115 , lat1 = - 45.00 , lng2 = 170 , lat2 = - 5 ) %> %
11
+ addSearchOSM(options = searchOptions(moveToLocation = FALSE , zoom = NULL )) %> %
12
+ addMapPane(name = " layers" , zIndex = 200 ) %> %
13
+ addMapPane(name = " maplabels" , zIndex = 400 ) %> %
14
+ addMapPane(name = " markers" , zIndex = 205 ) %> %
15
+ addProviderTiles(" CartoDB.VoyagerNoLabels" ) %> %
16
+ addProviderTiles(" CartoDB.VoyagerOnlyLabels" ,
17
+ options = leafletOptions(pane = " maplabels" ),
18
+ group = " map labels" )
19
+ rvs $ map_tour
20
+ })
21
+
22
+ output $ nextButtonControl <- renderUI({
23
+ if (rvs $ tour_tab != n_tour_windows ) actionButton(" nextButton" , " Next" ) else NULL
24
+ })
25
+
26
+ output $ backButtonControl <- renderUI({
27
+ if (rvs $ tour_tab != 1 ) actionButton(" backButton" , " Back" ) else NULL
28
+ })
29
+
30
+ observeEvent(input $ nextButton , {
31
+ rvs $ tour_tab <- rvs $ tour_tab + 1
32
+ })
33
+
34
+ observeEvent(input $ backButton , {
35
+ rvs $ tour_tab <- rvs $ tour_tab - 1
36
+ })
37
+
38
+ output $ tourText <- renderUI({
39
+ HTML(tour_text [[rvs $ tour_tab ]])
40
+ })
6
41
7
42
output $ map <- renderLeaflet({
8
43
rvs $ map <-
0 commit comments