Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8214219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:23:16+00:00 2026-06-07T11:23:16+00:00

I am using Google Maps API 3. I have a map and a button.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:23:18+00:00Added an answer on June 7, 2026 at 11:23 am

    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:

    var polyline = new google.maps.Polyline({path:[marker1.getPosition(), marker2.getPosition()});
    

    Tested in IE on this map

    with this in the address bar:

    javascript:{var polyline = new google.maps.Polyline({path:[gmarkers[0].getPosition(), gmarkers[1].getPosition()], map:map});}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a map with multiple markers of companies using google maps API v3.
I am using Google Maps API v3 , and have several map markers that
I have the following problem. I have embedded a map using Google Maps' API.
I have made my own map using the google maps api. It is a
I'm using Google Maps' API and added a few markers in a map. Each
I'm using google maps api to have a map show up on my website
I am using google maps api to place markers on a map. The gps
I am Using Google maps api v3 and want to make markers using loop
Using Google Maps API v3 I have a map with the countries coloured using
I have created an infobox using google maps api v3 and infoBox from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.