0

传单地图未针对以下代码呈现。还要说明地图应如何适合闪亮仪表板中框的宽度。它检索推文但不呈现。

服务器.R

mapPlot <- function(searchTerm, maxTweets, lang, lat, long, rad){
   mapTweets <- searchTwitter(searchTerm, maxTweets, lang = "en", geocode = paste(lat,long,paste0=(rad,"mi"),sep="'")
    mapTweets.df <- twListToDF(mapTweets)
    return(mapTweets.df)
  }

  entity13 <- eventReactive(input$mapit,{

    entity13 <- mapPlot(input$k, input$nt, lang = "en", input$lat, input$long, input$rad)
    entity13
  })





   output$mymap <- renderLeaflet({

    m <- leaflet(entity13()) %>%  addTiles() %>% # addCircles(ct$longitude, ct$latitude, weight = 20, radius=50, color="#000000", stroke = TRUE,  fillOpacity = 0.8) 
      addMarkers(entity13()$longitude, entity13()$latitude, popup = entity13()$screenName)

    # m %>% addPopups(~longitude, ~latitude, ~text)  

    m %>% setView(entity13()$longitude, entity13()$latitude, zoom = 4)
    return(m)
    })

用户界面

column(width = 8,
                         box(width = NULL, leafletOutput("mymap",height="500px"), collapsible = TRUE,
                             title = "Visualization of the place where the tweets popped from", status = "primary", solidHeader = TRUE)
                  )

传单地图未呈现。

有针对这个的解决方法吗?

4

0 回答 0