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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -