Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

PHP Google maps static api change path line to real path direction

I'm using array to bring cities names to make a static map using google maps api the problem is that i trying to make a real directions between markers that now present as lines, i googled in this topic but its giving javascript solution over coordinates using overview_polyline, and as i not experience i don't know how to applicate it on my example.

code:

$map2 = array("JAGUARIUNA,São+Paulo", "ANDRADINA,São+Paulo");

$map ="https://maps.googleapis.com/maps/api/staticmap? 
center=".$map2[0]."&zoom=6&size=2048x2048&maptype=roadmap"; 
$map .="&markers=color:green|size:mid|label:A|".$map2[0];
$map .="&markers=color:green|size:mid|label:Z|".$map2[1];

$map .="&path=color:0x0000ff|weight:5|";
$map .=$map2[0]."|".$map2[1];
$map .="&mode=transit&key=#####";

then how to change this path line to become a real path direction

Comments