I want to tap on map, display the point on the map, and also print a text repr of it, but I think I’m overcomplicating it.
tiles = hv.Tiles('https://maps.wikimedia.org/osm-intl/{Z}/{X}/{Y}@2x.png', name="Wikipedia")
stream = hv.streams.Tap(x=0, y=0)
text = pn.pane.Str('Click something', width=200)
taps = []
@pn.depends(stream.param.x, stream.param.y)
def location(x, y):
text.value = f'Click at {x:.2f}, {y:.2f}'
taps.append((x, y, 1))
return gv.Points(taps, crs=ccrs.PlateCarree(), vdims='Taps').opts(projection=ccrs.GOOGLE_MERCATOR, global_extent=True) * tiles
taps_dmap = hv.DynamicMap(location, streams=[stream])
pn.Row(taps_dmap, text)