Polylines with start and end of location in Google maps v3 -


i have drawing polylines following:

var data = json.parse(data);      var linecordinates = new array();      (i=0; i<data.length; i++){      linecordinates[i] = new google.maps.latlng(data[i].fields.latitude, data[i].fields.longitude);          }       linepath = new google.maps.polyline({         path: linecordinates,         geodesic: true,         strokecolor: '#ff0000',         strokeopacity: 1.0,         strokeweight: 2       });        linepath.setmap(map);      } 

i want place marker @ start of polygon line , end of polygon line. how that?

  • documentation on google.maps.polyline
  • markers

    var startmarker = new google.maps.marker({       position:linepath.getpath().getat(0),        map:map     }); var endmarker =  new google.maps.marker({       position:linepath.getpath().getat(linepath.getpath().getlength()-1),        map:map     }); 

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -