Untitled

mail@pastecode.io avatar
unknown
r
2 years ago
1.1 kB
7
Indexable
Never
library(shiny)

yanmap_link_fmt = "https://static-maps.yandex.ru/1.x/?ll=%f,%f&size=600,600&z=13&l=map&pt=%f,%f,pmwtm1~37.64,55.76363,pmwtm99"

ui = fluidPage(

    titlePanel("Old Faithful Geyser Data"),
      mainPanel(
        
        fluidRow(
          column(5, textInput("latitude", label=h2("Поле ввода"), value = "Введите широту"))
        ),
          column(5, textInput("longitude", label=h2("Поле ввода"), value = "Введите долготу"))
        ),
          div(id="map", style="width: 600px; height: 600px"),
          actionButton("action", label = "Показать"),
          textOutput("latitude_output"),
          textOutput("longitude_output")
      )



server <- function(input, output) {
  output$latitude_output <- renderText({ 
    paste(input$latitude)
  })
  output$longitude_output <- renderText({ 
    paste(input$longitude)
  })
  
  link = sprintf(yanmap_link_fmt, 55.001, 33.002, 55.001, 33.002)
  print(link)
}

shinyApp(ui = ui, server = server)