Skip to content

Tiles attribution not showing when using custom tile server #765

@ernhollam

Description

@ernhollam

ALL software version info

Software Version Info
bokeh                     3.5.2           py311h746a85d_0
cartopy                   0.22.0          py311h786e728_0
geoviews                  1.13.0          py311haa95532_0
geoviews-core             1.13.0          py311haa95532_0
holoviews                 1.19.1          py311haa95532_0
numpy                     1.26.4          py311hdab7c0b_0

Description of expected behavior and the observed behavior

When adding tile in geoviews, I expect the attribution of the underlying Bokeh model to show at the bottom right corner of the map, just like with any built-in tile server. However, it is not the case when I'm using custom tile server such as the French one. I think this might be a bug.
(Discussed at discourse post)

Complete, minimal, self-contained example code that reproduces the issue

from bokeh.plotting import figure, show
from bokeh.io import output_notebook
from bokeh.models import WMTSTileSource

output_notebook()

import cartopy.crs as ccrs
import numpy as np

import geoviews as gv
gv.extension('bokeh')

x_bounds=(2.14572, 2.61568)
y_bounds=(48.68763, 49.01233)
google_mercator_bbox = ccrs.GOOGLE_MERCATOR.transform_points(
        ccrs.PlateCarree(), x=np.array(x_bounds), y=np.array(y_bounds)
    )[:, :-1].flatten()

PLANIGNV2_tile_provider = WMTSTileSource(url="https://data.geopf.fr/tms/1.0.0/GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2/{Z}/{X}/{Y}.png",
                              name='PLAN IGN',
                              attribution=""" <a href="https://www.ign.fr/" target="_blank">&copy; IGN</a> maps""",
                              max_zoom=19)

# This shows the attributions at the bottom of the map
plan_ign_v2 = figure(x_range=(google_mercator_bbox[0], google_mercator_bbox[2]),
                     y_range=(google_mercator_bbox[1], google_mercator_bbox[3]),
                     min_width=800, min_height=400,
                     x_axis_type='mercator', y_axis_type='mercator',
                     active_drag='pan', active_scroll='wheel_zoom', match_aspect=True)
plan_ign_v2.add_tile(local_PLANIGNV2_tile_provider)
show(plan_ign_v2)

# The attribution is not visible using gv.WMTS()
gv.WMTS(PLANIGNV2_tile_provider).opts(active_tools=['wheel_zoom'], min_height=500, min_width=800,
                              xlim=(google_mercator_bbox[0], google_mercator_bbox[2]),
                     ylim=(google_mercator_bbox[1], google_mercator_bbox[3]))

# However it's there with the built-in OSM tile sources
gv.tile_sources.OSM().opts(active_tools=['wheel_zoom'], min_height=500, min_width=800,
                              xlim=(google_mercator_bbox[0], google_mercator_bbox[2]),
                     ylim=(google_mercator_bbox[1], google_mercator_bbox[3]))

Screenshots

Attributions shows with figure.add_tile()
gv.WMTS() with custom tile server
gv.tile_sources.OSM()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions