I am using Google Maps for my website and I wander how can I use the Markers as links? I mean when I click a marker to open a particular link.
Thank you in advance!
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.
That’s actually very easy to do. Simply attach an event handler to your marker, and then launch the link by setting
window.location.hrefto your URL. Check out the following examples, which I think should be self explanatory:Using the v3 API:
Using the V2 API:
The above examples will add a marker somewhere in the atlantic ocean. When you click on it, you’ll be forwarded to a popular search engine.