Can anyone share some JavaScript that enumerates all markers in a Google Map?
Need script for v2 and v3 if possible. Thanks.
Can anyone share some JavaScript that enumerates all markers in a Google Map? Need
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The only time you have access to the markers and can enumerate them is when they are created. The map has no awareness of what markers are attached to it, and it seems like you want to be able to do it on a map that has been initialised and markers have been added.
In other words, that is not possible. The way to do this is to put the markers into an array while you make them.