ogcserver: apply patch from crschmidt to support correct layer ordering in GetCaps response (closes #226)
This commit is contained in:
parent
3c1b67ccd4
commit
06e073c7ba
3 changed files with 4 additions and 2 deletions
|
@ -40,6 +40,7 @@ def ServiceHandlerFactory(conf, mapfactory, onlineresource, version):
|
|||
class BaseWMSFactory:
|
||||
def __init__(self):
|
||||
self.layers = {}
|
||||
self.ordered_layers = []
|
||||
self.styles = {}
|
||||
self.aggregatestyles = {}
|
||||
|
||||
|
@ -85,6 +86,7 @@ class BaseWMSFactory:
|
|||
layer.wmsextrastyles = extrastyles
|
||||
else:
|
||||
raise ServerConfigurationError('Layer "%s" was passed an invalid list of extra styles. List must be a tuple of strings.' % layername)
|
||||
self.ordered_layers.append(layer)
|
||||
self.layers[layername] = layer
|
||||
|
||||
def register_style(self, name, style):
|
||||
|
|
|
@ -152,7 +152,7 @@ class ServiceHandler(WMSBaseServiceHandler):
|
|||
rootlayercrs.text = epsgcode.upper()
|
||||
rootlayerelem.append(rootlayercrs)
|
||||
|
||||
for layer in self.mapfactory.layers.values():
|
||||
for layer in self.mapfactory.ordered_layers:
|
||||
layerproj = Projection(layer.srs)
|
||||
layername = ElementTree.Element('Name')
|
||||
layername.text = layer.name
|
||||
|
|
|
@ -158,7 +158,7 @@ class ServiceHandler(WMSBaseServiceHandler):
|
|||
rootlayercrs.text = epsgcode.upper()
|
||||
rootlayerelem.append(rootlayercrs)
|
||||
|
||||
for layer in self.mapfactory.layers.values():
|
||||
for layer in self.mapfactory.ordered_layers:
|
||||
layerproj = Projection(layer.srs)
|
||||
layername = ElementTree.Element('Name')
|
||||
layername.text = layer.name
|
||||
|
|
Loading…
Reference in a new issue