Skip to content

Commit

Permalink
#74 further improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed May 11, 2022
1 parent f4cbfb8 commit 60c5aab
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
19 changes: 17 additions & 2 deletions R/WMSLayer.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,16 @@ WMSLayer <- R6Class("WMSLayer",
layerStyles <- list
styleXML <- children[names(children)=="Style"]
if(!is.null(styleXML)){
layerStyles <- as.character(sapply(styleXML, function(x){xmlValue(xmlChildren(x)$Name)}))
layerStylenames <- as.character(sapply(styleXML, function(x){xmlValue(xmlChildren(x)$Name)}))
layerStyles <- lapply(styleXML, function(x){
list(
name = xmlValue(xmlChildren(x)$Name),
title = xmlValue(xmlChildren(x)$Title),
abstract = xmlValue(xmlChildren(x)$Abstract),
legendUrl = xmlGetAttr(xmlChildren(xmlChildren(x)$LegendURL)$OnlineResource, "xlink:href")
)
})
names(layerStyles) <- layerStylenames
}

dimensions <- list()
Expand Down Expand Up @@ -208,11 +217,17 @@ WMSLayer <- R6Class("WMSLayer",
},

#'@description Get layer styles
#'@return list of objects of class \code{character}
#'@return an object of class \code{list}
getStyles = function(){
return(private$styles)
},

#'@description Get layer style names
#'@return list of object of class \code{character}
getStylenames = function(){
return(names(private$styles))
},

#'@description Get layer dimensions
#'@param time_format time format. Default is \code{character}
#'@return a \code{list} including default value and listed possible values
Expand Down
16 changes: 15 additions & 1 deletion man/WMSLayer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 60c5aab

Please sign in to comment.