From bf7d321927fab77eb83076a2e7296baef4d0201e Mon Sep 17 00:00:00 2001 From: Nicolas-OREPC Date: Mon, 11 Aug 2014 17:04:33 +0200 Subject: [PATCH] Dimensions in getLayerFromContext() Properly handle dimensions to get the correct param values when creating a layer from a context. --- lib/OpenLayers/Format/Context.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/OpenLayers/Format/Context.js b/lib/OpenLayers/Format/Context.js index 8e69ca3487..0701e52dbb 100644 --- a/lib/OpenLayers/Format/Context.js +++ b/lib/OpenLayers/Format/Context.js @@ -163,6 +163,18 @@ OpenLayers.Format.Context = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, } } } + if (layerContext.dimensions) { + for (var key in layerContext.dimensions) { + var dimension = layerContext.dimensions[key]; + if (dimension.current == true) { + if (dimension.name == "time" || dimension.name == "elevation"){ + params[dimension.name] = dimension.userValue; + } else { + params["dim_" + dimension.name] = dimension.userValue; + } + } + } + } if (this.layerParams) { OpenLayers.Util.applyDefaults(params, this.layerParams); }