def size(self): if not self._size: legend = self.get_legend( LegendQuery(format='image/png', scale=None)) # TODO image size without as_image? self._size = legend.as_image().size return self._size
def legend(self, request): p = request.params query = LegendQuery(p.format, p.scale) for lyr in self.legend_layers: yield lyr.get_legend(query)