def __init__(self, name, title, this, layers, md=None): self.name = name self.title = title self.this = this self.md = md or {} self.is_active = True if this is not None else False self.layers = layers self.has_legend = True if this and this.has_legend or any(l.has_legend for l in layers) else False self.queryable = True if this and this.queryable or any(l.queryable for l in layers) else False all_layers = layers + ([self.this] if self.this else []) self.extent = merge_layer_extents(all_layers) self.res_range = merge_layer_res_ranges(all_layers)
def __init__(self, name, title, map_layers, info_layers=[], legend_layers=[], res_range=None, md=None): self.name = name self.title = title self.md = md or {} self.map_layers = map_layers self.info_layers = info_layers self.legend_layers = legend_layers self.extent = merge_layer_extents(map_layers) if res_range is None: res_range = merge_layer_res_ranges(map_layers) self.res_range = res_range self.queryable = True if info_layers else False self.transparent = all(not map_lyr.is_opaque() for map_lyr in self.map_layers) self.has_legend = True if legend_layers else False
def __init__(self, name, title, map_layers, info_layers=[], legend_layers=[], res_range=None, md=None): self.name = name self.title = title self.md = md or {} self.map_layers = map_layers self.info_layers = info_layers self.legend_layers = legend_layers self.extent = merge_layer_extents(map_layers) if res_range is None: res_range = merge_layer_res_ranges(map_layers) self.res_range = res_range self.queryable = True if info_layers else False self.has_legend = True if legend_layers else False