From fb48309b28dca0d5e2247b78353860108ec24031 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ma=C3=ABl=20M=C3=A9liani?= <m.meliani@neogeo-online.net>
Date: Mon, 21 Oct 2013 15:44:39 +0200
Subject: [PATCH] Fixed bug about XML response for the layergroup class.

---
 src/server.py | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/server.py b/src/server.py
index d5a97df..0cbb0b9 100755
--- a/src/server.py
+++ b/src/server.py
@@ -1107,21 +1107,23 @@ class layergroup(object):
 
         latlon_extent = lg.get_latlon_extent()
 
+        bounds = {"minx": latlon_extent.minX(),
+            "miny": latlon_extent.minY(),
+            "maxx": latlon_extent.maxX(),
+            "maxy": latlon_extent.maxY(),
+            "crs": "EPSG:4326",
+            }
+
         return {"layerGroup": ({
                     "name": lg.name,
-                    "mode": None, # TODO
-                    "publishables": [{
+                    "mode": "NAMED", # Only available mode in MRA.
+                    "publishables": Entries([{
                             "name": layer.ms.name,
                             "href": "%s/layers/%s.%s" % (web.ctx.home, layer.ms.name, format),
-                            } for layer in lg.iter_layers()],
-                    "bounds": {
-                        "minx": latlon_extent.minX(),
-                        "miny": latlon_extent.minY(),
-                        "maxx": latlon_extent.maxX(),
-                        "maxy": latlon_extent.maxY(),
-                        "crs": "EPSG:4326",
-                        },
-                    "styles": [],
+                            } for layer in lg.iter_layers()], tag_name="published"),
+                    "bounds": Entries(bounds),
+                    # TODO: Styles
+                    # "styles": [],
                     })
                 }
 
-- 
GitLab