1
server <- function(input, output){
output$map <-renderLeaflet({   
df_data <- uploadshapefile()
...
df_data <- as.data.frame(df_data)
    df_data@data$


id <- nrow(df_data)
    lm.palette <- colorRampPalette(c("red","white","blue","blue4"), space = "rgb")
    m <- mapview(df_data, zcol="quadrant",
            col.regions = lm.palette(20), map = NULL,
            main = "Local Moran's I", pretty = T) 
 })        
 output$clustered_map <- renderLeaflet({
      m <- m()
      m@map 
    })
}

This is the server part of my app, here I cannot get the mapview properly. i.e. I cannot view the base layers with my map. there is no base layers in my leaflet mapview but zoom in, zoom out and panning data is possible. I also followed this link. But no use. I want to get the solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.