Skip to content

Commit

Permalink
fix #394
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Oct 27, 2024
1 parent 848f61c commit cd71753
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions inst/actions/geosapi_publish_ogc_services.R
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ function(action, entity, config){
#styles publication if needed
gs_styles <- c(GS$getStyleNames(), GS$getStyleNames(ws = workspace))
if(data_object$styleUpload) if(length(data_object$styles)>0){
reload_styles = FALSE
for(i in 1:length(data_object$styles)){
style <- data_object$styles[i]
#check if any style SLD file is available in source
Expand All @@ -425,11 +426,14 @@ function(action, entity, config){
if(style_sldfile %in% data_object$source){
config$logger.info(sprintf("Creating GeoServer style '%s' from SLD style file '%s' available as source", style, style_sldfile))
created <- GS$createStyle(file = file.path(getwd(), "data", style_sldfile), name = style, ws = workspace)
if(created) reload_styles = TRUE
}
}
}
GS$reload()
gs_styles <- c(GS$getStyleNames(), GS$getStyleNames(ws = workspace))
if(reload_styles){
GS$reload()
gs_styles <- c(GS$getStyleNames(), GS$getStyleNames(ws = workspace))
}
}

#layer build and publication
Expand Down

0 comments on commit cd71753

Please sign in to comment.