From 30d930c70923d3dcace90493e7c0c5b3252f22dc Mon Sep 17 00:00:00 2001 From: Jean-Francois Doyon Date: Fri, 21 Apr 2006 00:18:07 +0000 Subject: [PATCH] - Updates docs/ogcserver/readme.txt - Added GetCapabilities named style support to 1.1.1 --- bindings/python/mapnik/ogcserver/wms111.py | 10 ++++++++++ docs/ogcserver/readme.txt | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bindings/python/mapnik/ogcserver/wms111.py b/bindings/python/mapnik/ogcserver/wms111.py index 0370468c5..d904b5305 100644 --- a/bindings/python/mapnik/ogcserver/wms111.py +++ b/bindings/python/mapnik/ogcserver/wms111.py @@ -167,6 +167,16 @@ class ServiceHandler(WMSBaseServiceHandler): layere.append(layertitle) layere.append(latlonbb) layere.append(layerbbox) + if len(layer.wmsextrastyles) > 0: + for extrastyle in list(layer.wmsextrastyles): + style = ElementTree.Element('Style') + stylename = ElementTree.Element('Name') + stylename.text = extrastyle + styletitle = ElementTree.Element('Title') + styletitle.text = extrastyle + style.append(stylename) + style.append(styletitle) + layere.append(style) rootlayerelem.append(layere) self.capabilities = '\n' + ElementTree.tostring(capetree) diff --git a/docs/ogcserver/readme.txt b/docs/ogcserver/readme.txt index b874bd07a..fd973fca6 100644 --- a/docs/ogcserver/readme.txt +++ b/docs/ogcserver/readme.txt @@ -101,7 +101,8 @@ class WMSFactory(BaseWMSFactory): lyr = Layer(name='layername') ... - self.register_layer(lyr) + self.register_layer(lyr, ('extra', 'style', 'names')) + self.finalize() The rules for writing this class are: @@ -112,4 +113,6 @@ The rules for writing this class are: - style and layer names are meant for machine readability, not human. Keep them short and simple, without spaces or special characters. - The layers must have at least one style associated with them (a default). -- No Map() object is used or needed here. \ No newline at end of file +- No Map() object is used or needed here. +- Be sure to call self.finalize() once you've registered everything! This will + validate everything and let you know if there's problems. \ No newline at end of file