Click point in map to trigger event

Hi,

I’m looking to set up a small app that allows me to click on points in a map, and show images corresponding to the point that was clicked.

I’m able to read the points and show them on a map (using Geoviews and the regular Bokeh backend). I’m also able to show the images in a pn.pane.JPG and update the images by changing the .object property.

However, I’ve not been able to figure out how I can trigger the event to update the image when the user clicks a point on the map. Does anyone know whether it’s possible to take action when the user clicks on a point? And if so, can give me some pointers on how to get started?

Thanks a lot for any input!

It sounds like you’re looking for hv.streams.Tap (http://holoviews.org/reference/streams/bokeh/Tap.html). It allows you to watch for taps on the map and trigger a callback when a tap is registered. It’s achieved by using the hv.DynamicMap functionality.

There is another example of this on discourse here that might also be helpful: Example of using holoviews TapStream with Panel . This one is using panel depends for the callback.

2 Likes