# Hiding map tiles attribution when multiple tiles renderer are added to the plot

**URL:** <https://discourse.bokeh.org/t/hiding-map-tiles-attribution-when-multiple-tiles-renderer-are-added-to-the-plot/12342>\
**Category:** Community Support\
**Tags:** customjs, bokeh\
**Created:** [March 15, 2025, 12:33pm UTC](https://discourse.bokeh.org/t/hiding-map-tiles-attribution-when-multiple-tiles-renderer-are-added-to-the-plot/12342 "2025-03-15T12:33:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davide-sd](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/davide-sd/32/3489_2.png) [@Davide-sd](https://discourse.bokeh.org/u/Davide-sd)\
**Post date:** [March 15, 2025, 12:33pm UTC](https://discourse.bokeh.org/t/hiding-map-tiles-attribution-when-multiple-tiles-renderer-are-added-to-the-plot/12342/1 "2025-03-15T12:33:23Z")

</div>

Consider the following application, in which the user can choose a tile provider (the logic is implement with Javascript to make this process on the client rather than spending server resources).

All tiles renderers are added when the figure is created, but only the selected tile renderer is visible. However, the attribution box on the figure shows attributions for all tile renderers, even the ones that are currently hidden.

Is there any way to hide tiles attribution when a tile renderer is hidden?

 ![image](https://discourse-uploads.bokeh.org/original/2X/7/7e8a919ec75a9788038e6d11f63d1ffe1730ad5d.jpeg)

```py
import panel as pn
from bokeh.plotting import figure
pn.extension()

map_selector = pn.widgets.Select(
    name="Tiles",
    options=[
        "OpenStreetMap.Mapnik",
        "OpenTopoMap",
        "CartoDB.Positron",
        "CartoDB.Voyager",
        "Esri.WorldImagery",
    ]
)

p = figure(
    x_axis_type="mercator", 
    y_axis_type="mercator",
    x_range=(1289584.505648815, 1489584.505648815),
    y_range=(5045162.214307019, 5245162.214307019),
)
p.grid.visible = False
p.match_aspect = True

tiles_renderers = {}
for k in map_selector.options:
    tiles_renderers[k] = p.add_tile(k, retina=True)
    tiles_renderers[k].visible = (k == map_selector.value)

map_selector.jscallback(
    args={
        "tiles_renderers": tiles_renderers,
        "map_selector": map_selector,
    },
    value="""
for (const [key, value] of Object.entries(tiles_renderers)) {
  value.visible = (key === map_selector.value)
}
""")

pn.Row(map_selector, p)

```

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [March 26, 2025, 8:21pm UTC](https://discourse.bokeh.org/t/hiding-map-tiles-attribution-when-multiple-tiles-renderer-are-added-to-the-plot/12342/2 "2025-03-26T20:21:10Z")

</div>

@Davide-sd Panel It’s possible that Bokeh is not considering the underlying renderer visibility when collecting attributions to display. I’d suggest you make a [GitHub Issue](https://github.com/bokeh/bokeh/issues) with full details.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [June 24, 2025, 8:21pm UTC](https://discourse.bokeh.org/t/hiding-map-tiles-attribution-when-multiple-tiles-renderer-are-added-to-the-plot/12342/3 "2025-06-24T20:21:25Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
