How to use Google map poly-line API by passing array of coordinates dynamically? -
enter image description here new google api. please me use google map poly-line api passing array of coordinates dynamically?
make array of latlng , use array path in polyline obj
var latlngarray = [[lat,lng],[lat,lng],[lat,lng],[lat,lng]]; var patharray = []; (var = 0;i<latlngarray .length ;i++){ patharray.push(new google.maps.latlng(latlngarray[i][0],latlngarray[i][1])); } var tourplan = new google.maps.polyline({ path : patharray , strokecolor : "#0000ff", strokeopacity : 0.6, strokeweight : 2, }); tourplan.setmap(map)
Comments
Post a Comment