- Where Developers Learn, Share, & Build Careers


I am using Google Maps API3. I have a map and a button. On the map, I have two markers when I click on the button, then I want to draw a line between the two markers.

Not sure why you need Ajax with 2 markers and Google Maps API v3 Can draw a straight line between the two.

Something like this (play on the button click) should work with the correct names of marker 1 and marker 2:

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

Check it in IE

In the address bar with:

  Javascript: {var polyline = new google.maps (Path: [gunners [0] .getPosition (), gmarkers [1] .getPosition ()], map: map}}}    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -