def layer(self, queryset, stylename=None):
        cls = VectorLayer if hasattr(queryset, 'geojson') else RasterLayer
        layer = cls(queryset)
        stylename = stylename or layer.stylename
        try:
            style = self.map.find_style(stylename)
        except __HOLE__:
            self.map.append_style(stylename, layer.style())
        layer.styles.append(stylename)
        self.map.layers.append(layer._layer)
        return layer
dataset/ETHPy150Open bkg/django-spillway/spillway/carto.py/Map.layer