Commit efe61d92 authored by Sylvain Falala's avatar Sylvain Falala
Browse files

Bug fix on file loading

parent e5903ff7
......@@ -135,8 +135,7 @@ server <- function(input, output, session) {
# Load layers
layerFiles$name <- as.character(layerFiles$name)
nbFiles <- nrow(layerFiles)
layerFiles$isNull <- rep(FALSE, nbFiles)
......@@ -163,13 +162,21 @@ server <- function(input, output, session) {
}
if(all(layerFiles$isNull==TRUE)) {
print("Selected files are no layers")
return()
}
acceptedFiles <- layerFiles
indRem <- which(layerFiles$isNull==TRUE)
acceptedFiles <- layerFiles[-indRem,]
if(!is.na(indRem[1])) acceptedFiles <- layerFiles[-indRem,]
nbLayer <- nrow(acceptedFiles)
# Update dataframe with info on layers
layerInfo <- subset(acceptedFiles, select = name)
......@@ -177,6 +184,7 @@ server <- function(input, output, session) {
# Retrieve class of layer
layerInfo$layerType <- as.character(sapply(tempLayer, class))
# Rename class name
layerInfo$layerType <- gsub("SpatialPolygonsDataFrame", lVect[indLang], layerInfo$layerType, fixed = TRUE)
layerInfo$layerType <- gsub("RasterLayer", lRast[indLang], layerInfo$layerType, fixed = TRUE)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment