How to add click event handler for objectManager in React yandex maps?
P粉450079266
P粉450079266 2023-09-16 20:11:32
0
1
490

I'm using the react-yandex-maps (https://github.com/R1ZEN/react-yandex-maps) library, and I need to handle click events for a single landmark, but I don't know how to do it. How do I add an onClick event on the render object on the map?

   ({ type: "Feature", id: el.id, geometry: { type: "Point", coordinates: [el.lat, el.long], }, } ))} />  
P粉450079266
P粉450079266

reply all (1)
P粉083785014

Here’s how to do it.

 { const id = e.get('objectId'); // 获取Id console.log(`Id is: ${id}`); }} />
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!