How to fetch dataset info when clicking on google maps pins

Hi,
I have built a website with a google map and multiple locations (identified by pins on the map) and a dataset with a set of extra info for each of location.
I would like to get the location A info (from the dataset) displayed in a box once the user click on a location A but:

I couldn’t find a way to catch the onclick event on the google map pin (related to location A)
I’m not sure how to retrieve from the dataset the info related to the location A

Anyone who could help or point me in the right direction?

Thanks a lot!

Hi!
Here’s an example that does something similar, using location to change the text at the bottom based on the markers clicked : https://www.wix.com/velo/forum/tips-tutorials-examples/example-multiple-markers-google-maps . Let me know if this helps.