library(shiny)
library(leaflet)
library(readr)
library(dplyr)
library(tidyr)
library(splitstackshape)
library(DT)
library(maptools)
options(shiny.maxRequestSize=1024*1024^2)
# 定义配色方案 ----
ui <- fluidPage(
useShinyjs(),
titlePanel("测试Demo"),
helpText("Demo"),
fileInput(inputId="segment_file", label="TSV文件", buttonLabel="浏览", placeholder="没有文件被选中"),
hr(),
helpText("输入"),
dataTableOutput("dt"),
leafletOutput("segment_plot", height=600)
)
# 服务端功能 ----
server <- function(input, output, session) {
segment_trace <- reactive({
segmentFile <- input$segment_file$datapath
if(is.null(input$segment_file)) {
segment_trace <- read_tsv("/geohash_block_route") %>%
mutate(s_lng11=gh_decode(start_geohash)$lng-gh_decode(start_geohash)$lng_error, s_lng12=gh_decode(start_geohash)$lng+gh_decode(start_geohash)$lng_error,
s_lat11=gh_decode(start_geohash)$lat-gh_decode(start_geohash)$lat_error, s_lat12=gh_decode(start_geohash)$lat+gh_decode(start_geohash)$lat_error,
e_lng11=gh_decode(end_geohash)$lng-gh_decode(end_geohash)$lng_error, e_lng12=gh_decode(end_geohash)$lng+gh_decode(end_geohash)$lng_error,
e_lat11=gh_decode(end_geohash)$lat-gh_decode(end_geohash)$lat_error, e_lat12=gh_decode(end_geohash)$lat+gh_decode(end_geohash)$lat_error)
if(ncol(str_split(colnames(segment_trace), pattern="\\.", simpl
R leaflet:多路线
最新推荐文章于 2024-05-15 09:56:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)