|
1 | | - |
2 | | - |
3 | | -## TODO: |
4 | | -## TESTS |
5 | | -## - polylines - works with and without ID, for polyline and lat/lon columns |
6 | | -## - polygons - ditto |
7 | | - |
8 | | - |
9 | | -## two maps with the same layer_id ? |
10 | | - |
11 | | - |
12 | | -# library(shiny) |
13 | | -# library(shinydashboard) |
14 | | -# library(googleway) |
15 | | -# |
16 | | -# ui <- dashboardPage( |
17 | | -# |
18 | | -# dashboardHeader(), |
19 | | -# dashboardSidebar(), |
20 | | -# dashboardBody( |
21 | | -# box(width = 6, |
22 | | -# google_mapOutput(outputId = "map") |
23 | | -# ), |
24 | | -# box(width = 6, |
25 | | -# google_mapOutput(outputId = "pano") |
26 | | -# ) |
27 | | -# ) |
28 | | -# ) |
29 | | -# |
30 | | -# server <- function(input, output) { |
31 | | -# set_key(read.dcf("~/Documents/.googleAPI", fields = "GOOGLE_MAP_KEY")) |
32 | | -# |
33 | | -# output$map <- renderGoogle_map({ |
34 | | -# google_map(location = c(-37.817386, 144.967463), |
35 | | -# zoom = 14, |
36 | | -# split_view = "pano", |
37 | | -# split_view_options = list(heading = 275, pitch = 20) |
38 | | -# ) |
39 | | -# }) |
40 | | -# } |
41 | | -# |
42 | | -# shinyApp(ui, server) |
43 | | - |
44 | | - |
45 | | -# |
46 | | -# flinders <- "dhyeFezxsZnDwAP~@ZfCL|AQDc@eEMu@KDp@jFALMBu@_GKDx@~FMBaAyFKF~@xFMDC?cAwFEBdAxFQDeAuFIB`ArFSD" |
47 | | -# markers <- data.frame( |
48 | | -# lat = c(-37.81821,-37.8181,-37.81801,-37.81793,-37.81808,-37.81816,-37.81825,-37.81837,-37.81850,-37.81838,-37.81829,-37.81819,-37.81837,-37.81846,-37.81852,-37.81863,-37.81875,-37.81865,-37.81858,-37.81852), |
49 | | -# lon = c( 144.9656, 144.966, 144.9664, 144.9667, 144.9668, 144.9664, 144.9661, 144.9657, 144.9657, 144.9662, 144.9665, 144.9669, 144.9669, 144.9666, 144.9663, 144.9658, 144.9658, 144.9663, 144.9666, 144.9670) |
50 | | -# ) |
51 | | -# |
52 | | -# ## simulate data every 6/10/60 seconds within the polygons / close to markers? |
53 | | -# m <- as.matrix(googlePolylines::decode(flinders)[[1]]) |
54 | | -# m <- rbind(m, m[1,]) |
55 | | -# m <- m[,c(2,1)] |
56 | | -# sf_flinders <- sf::st_polygon(x = list(m)) |
57 | | -# |
58 | | -# library(shiny) |
59 | | -# library(shinydashboard) |
60 | | -# library(googleway) |
61 | | -# |
62 | | -# ui <- dashboardPage( |
63 | | -# dashboardHeader(), |
64 | | -# dashboardSidebar(), |
65 | | -# dashboardBody( |
66 | | -# google_mapOutput(outputId = "map", height = "800px"), |
67 | | -# actionButton(inputId = "circles", label = "add circles") |
68 | | -# ) |
69 | | -# ) |
70 | | -# |
71 | | -# server <- function(input, output) { |
72 | | -# |
73 | | -# set_key(read.dcf("~/Documents/.googleAPI", fields = "GOOGLE_MAP_KEY")) |
74 | | -# autoInvalidate <- reactiveTimer(10000) |
75 | | -# |
76 | | -# output$map <- renderGoogle_map({ |
77 | | -# google_map() |
78 | | -# }) |
79 | | -# |
80 | | -# observe({ |
81 | | -# autoInvalidate() |
82 | | -# pts <- sf::st_sf(geometry = sf::st_sample(sf_flinders, 500)) |
83 | | -# google_map_update(map_id = "map") %>% |
84 | | -# clear_circles() %>% |
85 | | -# add_circles(pts, radius = 1, stroke_weight = 0, update_map_view = F) |
86 | | -# }) |
87 | | -# } |
88 | | -# shinyApp(ui, server) |
89 | | - |
90 | | - |
91 | | - |
92 | | - |
0 commit comments