Google map - Multiple Markers and InfoWindows/Popups & CMS items

I’ve seen solutions for a fixed amount of locations but would it be possible to auto create markers anytime a new CMS items is created via an event listener connected to a “create marker” function?