Skip to content

The properties of a basemap do not change when the basemap does. #826

@algol60

Description

@algol60
Software Version Info
gv.__version__='1.15.0'
hv.__version__='1.20.2'
bokeh.__version__='3.8.1'

Description of expected behavior and the observed behavior

When using a HoloViews stream to change the basemap:

  • When the basemap changes, the displayed attribution does not change.
  • If the WMTS URL changes from WMTSTileSource style ({z} {x} {y}) to BBoxTileSource style ({XMIN},{YMIN},{XMAX},{YMAX}), or vice versa, the placeholders are not replaced with values. This can be seen in the browser's developer tools. This means that the tile server is being sent bad tile URLs.

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

import holoviews as hv
import geoviews as gv
from geoviews.element import WMTS
import bokeh

hv.extension('bokeh', inline=True)
gv.extension('bokeh', inline=True)
print(f'{gv.__version__=}\n{hv.__version__=}\n{bokeh.__version__=}') 

xy1 = gv.tile_sources.OSM
xy2 = gv.tile_sources.EsriImagery
mm1 = WMTS('https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/export?bbox={XMIN},{YMIN},{XMAX},{YMAX}&size=512,512&imageSR=&format=png&transparent=false&f=image')

# Start with a WMTSTileSource.
BmStream = hv.streams.Stream.define('basemap_stream', bm=xy1)
bm_stream = BmStream()

def callback(bm):
    return bm
    
dynmap = hv.DynamicMap(callback, streams=[bm_stream])
# Display the map in a notebook cell.
dynmap

# New notebook cell.
# Change basemap, but the displayed attribution does not change.
dynmap.event(bm=xy2)

# New notebook cell.
# Change to a BBoxTileSource, the URL containing the placeholders {XMIN} etc is used.
# See the browser's developer tools network tab.
dynmap.event(bm=mm1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions