Get ID of a MVTLayer-feature from coordinates (using pydeck and panel).


I’m want access the ID of a feature in a MVTLayer (or even better would be all of its properties) which is inside a Panel pane. Here is working example (or open it in Colab):

import panel as pn
import pydeck
from functools import partial

view_state = pydeck.ViewState(
    latitude = 33.740,
    longitude = 35.905,
    zoom = 10,
    max_zoom = 11.49,
    pitch = 45,
    bearing = 0

layer = pydeck.Layer(
    type = 'MVTLayer',
    data = "{z}/{x}/{y}.pbf",
    get_line_color = [0, 255, 0],
    get_fill_color = [155, 0, 100],
    line_width_min_pixels = 1,
    pickable = True,

deck = pydeck.Deck(
    layers = [layer],
    initial_view_state = view_state,
    map_style = "light",

pn_deck = pn.pane.DeckGL(deck)

def on_map_click(event, deck):


    # How to find the ID thats shown in the tooltip, deck = deck), ["click_state"])


When I hover over the map I can see the ID in the tooltip. When I click the map, there is a callback function (called on_map_click) in which I have access to the coordinates of the click, and the Deck.

So, given the variable deck (which contains the layer) and a coordinate, can I retrieve the corresponding ID (or properties)?

Thanks for any help!