Commit 988b73ea authored by Sylvain Falala's avatar Sylvain Falala
Browse files

fix bug when only 1 file of mobility is loaded

parent 478dcba6
Package: mapMCDA
Title: Produce an epidemiological risk map by weighting multiple risk factors
Version: 0.4.1
Version: 0.4.2
Date: 2019-04-06
Authors@R: c(
person("Andrea", "Apolloni", email = "andrea.apolloni@cirad.fr", role = c("ctb"), comment = "Animal mobility algorithm"),
......
......@@ -182,14 +182,19 @@ server <- function(input, output, session) {
layerInfo <- subset(acceptedFiles, select = name)
# Retrieve class of layer
layerInfo$layerType <- as.character(sapply(tempLayer, class))
if(nbLayer>1){
layerInfo$layerType <- as.character(sapply(tempLayer, class))
} else {
layerInfo$layerType <- paste(class(tempLayer[[1]]), collapse = "_")
}
# Rename class name
layerInfo$layerType <- gsub("SpatialPolygonsDataFrame", lVect[indLang], layerInfo$layerType, fixed = TRUE)
layerInfo$layerType <- gsub("RasterLayer", lRast[indLang], layerInfo$layerType, fixed = TRUE)
layerInfo$layerType <- gsub("c(\"geonetwork\", \"igraph\")", lMob[indLang], layerInfo$layerType, fixed = TRUE)
layerInfo$layerType <- gsub("geonetwork_igraph", lMob[indLang], layerInfo$layerType, fixed = TRUE)
# Create short name for the layers (based on the file name)
layerInfo$shortName <- rmext(layerInfo$name)
......
Markdown is supported
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