Using map tiles with a gridspace

I’m trying to create a GridSpace of chloropleths with background tiles (from open street maps). Basically, I want a bunch of grid of maps where the rows are different modeled parameters, the columns are the model year, and the polygons on the map are colored by the parameter value. And I want a tile underneath it to help users understand where they are looking it. Everything works well, until I try to add the tiles underneath. I’m getting the error AttributeError: unexpected attribute 'source' to TileRenderer, similar attributes are tile_source Is this a bug, a known incompatibility with tiles and Gridspaces, or something I’m just doing wrong.

Here’s what I’m doing:

def plot_inner_polygons(basin_size, impairment_criterion, nutrient, lu_source, col):
    # do some data selection
    return gv.Polygons(year_data, vdims=["HUC Name", col]).opts(
        # some formatting options
    )
def plot_outer_polygons(basin_size):
    # other data selection
    return gv.Polygons(year_data, vdims=["HUC Name", col]).opts(
        # some different formatting options
    )

# make the chloropleths
for basin_size in ["NJ HUC14", "HUC12"]:
    for impairment_criterion in ["Mean Annual Concentration", "Loading Rates"]:
        for col in [
            "value",
            "Impaired",
        ]:
            conc_grid_dict = {}
            for nutrient in nutrients.values():
                for lu_source in land_uses_to_plot:
                    conc_grid_dict[lu_source, nutrient] = plot_inner_polygons(
                        basin_size, impairment_criterion, nutrient, lu_source, col
                    ) * plot_outer_polygons(basin_size) * gts.OSM.opts(alpha=0.20)
            conc_holomap = hv.HoloMap(conc_grid_dict, kdims=[lu_dim, nutrient_dim])
            conc_grid = hv.GridSpace(conc_holomap).opts(title=title)

It seems like the GridSpace (and GridMatrix) must not be compatible with tiles. Just putting the tiles all by themselves still causes the same error.

Try:

import holoviews as hv
from holoviews import opts
hv.extension('bokeh')    

grid = hv.GridSpace(kdims=["row_dim", "col_dim"])
for row in ["row1", "row2", "row3"]:
    for col in ["col1", "col2", "col3"]:
        grid[row, col] = hv.element.tiles.OSM()
grid.opts(
    opts.GridSpace(
        xaxis="bottom", yaxis="left", shared_xaxis=False, shared_yaxis=False
    )
)

Sounds like it. Worth a bug report on the hv github repo.