def copy_layer(obj): lyr = Layer(obj.name) if hasattr(obj, 'title'): lyr.title = obj.title else: lyr.title = '' if hasattr(obj, 'abstract'): lyr.abstract = obj.abstract else: lyr.abstract = '' # only if mapnik version supports it # http://trac.mapnik.org/ticket/503 if hasattr(obj, 'tolerance'): lyr.tolerance = obj.tolerance if hasattr(obj, 'toleranceunits'): lyr.toleranceunits = obj.toleranceunits lyr.srs = obj.srs if hasattr(obj, 'minzoom'): lyr.minzoom = obj.minzoom if hasattr(obj, 'maxzoom'): lyr.maxzoom = obj.maxzoom lyr.active = obj.active lyr.queryable = obj.queryable lyr.clear_label_cache = obj.clear_label_cache lyr.datasource = obj.datasource if hasattr(obj, 'wmsdefaultstyle'): lyr.wmsdefaultstyle = obj.wmsdefaultstyle if hasattr(obj, 'wmsextrastyles'): lyr.wmsextrastyles = obj.wmsextrastyles if hasattr(obj, 'meta_style'): lyr.meta_style = obj.meta_style if hasattr(lyr, 'wms_srs'): lyr.wms_srs = obj.wms_srs return lyr
def copy_layer(obj): lyr = Layer(obj.name) if hasattr(obj, 'title'): lyr.title = obj.title else: lyr.title = '' if hasattr(obj, 'abstract'): lyr.abstract = obj.abstract else: lyr.abstract = '' # only if mapnik version supports it # http://trac.mapnik.org/ticket/503 if hasattr(obj, 'tolerance'): lyr.tolerance = obj.tolerance if hasattr(obj, 'toleranceunits'): lyr.toleranceunits = obj.toleranceunits lyr.srs = obj.srs lyr.minzoom = obj.minzoom lyr.maxzoom = obj.maxzoom lyr.active = obj.active lyr.queryable = obj.queryable lyr.clear_label_cache = obj.clear_label_cache lyr.datasource = obj.datasource if hasattr(obj,'wmsdefaultstyle'): lyr.wmsdefaultstyle = obj.wmsdefaultstyle if hasattr(obj,'wmsextrastyles'): lyr.wmsextrastyles = obj.wmsextrastyles if hasattr(obj,'meta_style'): lyr.meta_style = obj.meta_style if hasattr(lyr, 'wms_srs'): lyr.wms_srs = obj.wms_srs return lyr
def copy_layer(obj): lyr = Layer(obj.name) lyr.abstract = obj.abstract lyr.active = obj.active lyr.clear_label_cache = obj.clear_label_cache lyr.datasource = obj.datasource #lyr.maxzoom = obj.maxzoom #lyr.minzoom = obj.minzoom lyr.queryable = obj.queryable lyr.srs = obj.srs lyr.title = obj.title if hasattr(obj,'wmsdefaultstyle'): lyr.wmsdefaultstyle = obj.wmsdefaultstyle if hasattr(obj,'wmsextrastyles'): lyr.wmsextrastyles = obj.wmsextrastyles return lyr