I am using Google Maps API 3. I have a map and a button. On the map, I have two markers. When I click the button, I want to draw a line between the two markers.
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.
Not sure why you need Ajax. With 2 markers and the google maps API v3 you can draw a straight line between them.
something like this (run when the button is clicked) should work with the correct names of marker1 and marker2:
Tested in IE on this map
with this in the address bar: