I have code which generates markers on a Google map based on certain criteria. What I’m attempting to do is generate a list next to the map which would contain the address associated with each marker that appears on the list as well as a checkbox next to each address. At the bottom of this list would be a “refine” button which would return only the results which had their checkbox selected.
My question are:
-
How would I store the dynamically generated checkboxes and their respective address fields so that I could update and modify the selection with the refine button?
-
How would I (or should I) actually set each checkbox to run a function on onClick which would remove the marker from the map?
Create checkboxes on the fly inside a given div
To run through these checkboxes adding event handlers:
Then set up
myGeneralHandlerto handle clicks from any checkboxes.