From cc1862ca8b6dd0860f2870ceb1b2ad380babf42b Mon Sep 17 00:00:00 2001 From: eblondel Date: Wed, 27 Jan 2021 23:02:30 +0100 Subject: [PATCH] #43 consolidate wms/getFeatureInfo --- R/WMSLayer.R | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/R/WMSLayer.R b/R/WMSLayer.R index 8b37a75..5b4516e 100644 --- a/R/WMSLayer.R +++ b/R/WMSLayer.R @@ -196,7 +196,7 @@ WMSLayer <- R6Class("WMSLayer", }, #getFeatureInfo - getFeatureInfo = function(srs = NULL, crs = NULL, styles = NULL, feature_count = 1, + getFeatureInfo = function(srs = NULL, styles = NULL, feature_count = 1, x, y, width, height, bbox, info_format = "application/vnd.ogc.gml", ...){ @@ -206,15 +206,16 @@ WMSLayer <- R6Class("WMSLayer", } if(is.null(srs)){ - srs <- self$getBoundingBoxSRS() - } - if(is.null(crs)){ - crs <- self$getBoundingBoxCRS() + srs <- if(startsWith(private$version, "1.1")){ + self$getBoundingBoxSRS() + }else if(startsWith(private$version, "1.3")){ + self$getBoundingBoxCRS() + } } ftFeatures <- WMSGetFeatureInfo$new( op = op, url = private$url, version = private$version, - layers = private$name, srs = srs, crs = crs, styles = styles, + layers = private$name, srs = srs, styles = styles, feature_count = feature_count, x = x, y = y, width = width, height = height, bbox = bbox, info_format = info_format,